From 6b7344d17989e9e787ee65292bc6e5e53e16bfa0 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Mon, 9 Sep 2024 18:07:07 -0500 Subject: [PATCH] Release 2.2.0 --- .gitignore | 14 +- .openapi-generator/FILES | 397 ---- .openapi-generator/VERSION | 1 - README.md | 58 +- VERSION | 2 +- build.gradle | 18 +- build.sbt | 14 +- docs/AccountApi.md | 20 +- docs/AccountCreateRequest.md | 4 +- docs/AccountCreateResponse.md | 6 +- docs/AccountGetResponse.md | 6 +- docs/AccountResponse.md | 4 +- docs/AccountResponseQuotas.md | 4 +- docs/AccountResponseUsage.md | 4 +- docs/AccountUpdateRequest.md | 4 +- docs/AccountVerifyRequest.md | 4 +- docs/AccountVerifyResponse.md | 4 +- docs/AccountVerifyResponseAccount.md | 4 +- docs/ApiAppApi.md | 24 +- docs/ApiAppCreateRequest.md | 4 +- docs/ApiAppGetResponse.md | 6 +- docs/ApiAppListResponse.md | 8 +- docs/ApiAppResponse.md | 4 +- docs/ApiAppResponseOAuth.md | 4 +- docs/ApiAppResponseOptions.md | 4 +- docs/ApiAppResponseOwnerAccount.md | 4 +- docs/ApiAppResponseWhiteLabelingOptions.md | 4 +- docs/ApiAppUpdateRequest.md | 4 +- docs/BulkSendJobApi.md | 12 +- docs/BulkSendJobGetResponse.md | 10 +- ...BulkSendJobGetResponseSignatureRequests.md | 4 +- docs/BulkSendJobListResponse.md | 8 +- docs/BulkSendJobResponse.md | 4 +- docs/BulkSendJobSendResponse.md | 6 +- docs/EmbeddedApi.md | 12 +- docs/EmbeddedEditUrlRequest.md | 4 +- docs/EmbeddedEditUrlResponse.md | 6 +- docs/EmbeddedEditUrlResponseEmbedded.md | 4 +- docs/EmbeddedSignUrlResponse.md | 6 +- docs/EmbeddedSignUrlResponseEmbedded.md | 4 +- docs/ErrorResponse.md | 4 +- docs/ErrorResponseError.md | 4 +- docs/EventCallbackRequest.md | 4 +- docs/EventCallbackRequestEvent.md | 6 +- docs/EventCallbackRequestEventMetadata.md | 4 +- docs/FaxLineAddUserRequest.md | 16 + docs/FaxLineApi.md | 504 +++++ docs/FaxLineAreaCodeGetCountryEnum.md | 15 + docs/FaxLineAreaCodeGetProvinceEnum.md | 35 + docs/FaxLineAreaCodeGetResponse.md | 14 + docs/FaxLineAreaCodeGetStateEnum.md | 111 ++ docs/FaxLineCreateRequest.md | 27 + docs/FaxLineDeleteRequest.md | 14 + docs/FaxLineListResponse.md | 16 + docs/FaxLineRemoveUserRequest.md | 16 + docs/FaxLineResponse.md | 15 + docs/FaxLineResponseFaxLine.md | 17 + docs/FileResponse.md | 8 +- docs/FileResponseDataUri.md | 6 +- docs/ListInfoResponse.md | 4 +- docs/OAuthApi.md | 12 +- docs/OAuthTokenGenerateRequest.md | 4 +- docs/OAuthTokenRefreshRequest.md | 4 +- docs/OAuthTokenResponse.md | 4 +- docs/ReportApi.md | 8 +- docs/ReportCreateRequest.md | 6 +- docs/ReportCreateResponse.md | 6 +- docs/ReportResponse.md | 6 +- docs/SignatureRequestApi.md | 68 +- ...stBulkCreateEmbeddedWithTemplateRequest.md | 4 +- ...atureRequestBulkSendWithTemplateRequest.md | 4 +- docs/SignatureRequestCreateEmbeddedRequest.md | 4 +- ...equestCreateEmbeddedWithTemplateRequest.md | 4 +- docs/SignatureRequestGetResponse.md | 6 +- docs/SignatureRequestListResponse.md | 8 +- docs/SignatureRequestRemindRequest.md | 4 +- docs/SignatureRequestResponse.md | 4 +- docs/SignatureRequestResponseAttachment.md | 4 +- ...SignatureRequestResponseCustomFieldBase.md | 4 +- ...atureRequestResponseCustomFieldCheckbox.md | 4 +- ...SignatureRequestResponseCustomFieldText.md | 4 +- docs/SignatureRequestResponseDataBase.md | 4 +- ...gnatureRequestResponseDataValueCheckbox.md | 4 +- ...reRequestResponseDataValueCheckboxMerge.md | 4 +- ...atureRequestResponseDataValueDateSigned.md | 4 +- ...gnatureRequestResponseDataValueDropdown.md | 4 +- ...gnatureRequestResponseDataValueInitials.md | 4 +- .../SignatureRequestResponseDataValueRadio.md | 4 +- ...natureRequestResponseDataValueSignature.md | 4 +- docs/SignatureRequestResponseDataValueText.md | 4 +- ...natureRequestResponseDataValueTextMerge.md | 4 +- docs/SignatureRequestResponseSignatures.md | 4 +- docs/SignatureRequestSendRequest.md | 4 +- ...SignatureRequestSendWithTemplateRequest.md | 4 +- docs/SignatureRequestUpdateRequest.md | 4 +- docs/SubAttachment.md | 4 +- docs/SubBulkSignerList.md | 4 +- docs/SubBulkSignerListCustomField.md | 4 +- docs/SubCC.md | 4 +- docs/SubCustomField.md | 4 +- docs/SubEditorOptions.md | 4 +- docs/SubFieldOptions.md | 6 +- docs/SubFormFieldGroup.md | 4 +- docs/SubFormFieldRule.md | 4 +- docs/SubFormFieldRuleAction.md | 6 +- docs/SubFormFieldRuleTrigger.md | 6 +- docs/SubFormFieldsPerDocumentBase.md | 4 +- docs/SubFormFieldsPerDocumentCheckbox.md | 4 +- docs/SubFormFieldsPerDocumentCheckboxMerge.md | 4 +- docs/SubFormFieldsPerDocumentDateSigned.md | 18 +- docs/SubFormFieldsPerDocumentDropdown.md | 18 +- docs/SubFormFieldsPerDocumentFontEnum.md | 12 +- docs/SubFormFieldsPerDocumentHyperlink.md | 18 +- docs/SubFormFieldsPerDocumentInitials.md | 4 +- docs/SubFormFieldsPerDocumentRadio.md | 4 +- docs/SubFormFieldsPerDocumentSignature.md | 4 +- docs/SubFormFieldsPerDocumentText.md | 20 +- docs/SubFormFieldsPerDocumentTextMerge.md | 18 +- docs/SubMergeField.md | 6 +- docs/SubOAuth.md | 6 +- docs/SubOptions.md | 4 +- docs/SubSignatureRequestGroupedSigners.md | 4 +- docs/SubSignatureRequestSigner.md | 6 +- docs/SubSignatureRequestTemplateSigner.md | 6 +- docs/SubSigningOptions.md | 6 +- docs/SubTeamResponse.md | 4 +- docs/SubTemplateRole.md | 4 +- docs/SubUnclaimedDraftSigner.md | 4 +- docs/SubUnclaimedDraftTemplateSigner.md | 4 +- docs/SubWhiteLabelingOptions.md | 6 +- docs/TeamAddMemberRequest.md | 6 +- docs/TeamApi.md | 36 +- docs/TeamCreateRequest.md | 4 +- docs/TeamGetInfoResponse.md | 6 +- docs/TeamGetResponse.md | 6 +- docs/TeamInfoResponse.md | 4 +- docs/TeamInviteResponse.md | 4 +- docs/TeamInvitesResponse.md | 6 +- docs/TeamMemberResponse.md | 4 +- docs/TeamMembersResponse.md | 8 +- docs/TeamParentResponse.md | 4 +- docs/TeamRemoveMemberRequest.md | 6 +- docs/TeamResponse.md | 4 +- docs/TeamSubTeamsResponse.md | 8 +- docs/TeamUpdateRequest.md | 4 +- docs/TemplateAddUserRequest.md | 4 +- docs/TemplateApi.md | 48 +- docs/TemplateCreateEmbeddedDraftRequest.md | 4 +- docs/TemplateCreateEmbeddedDraftResponse.md | 6 +- ...lateCreateEmbeddedDraftResponseTemplate.md | 4 +- docs/TemplateCreateRequest.md | 4 +- docs/TemplateCreateResponse.md | 6 +- docs/TemplateCreateResponseTemplate.md | 4 +- docs/TemplateEditResponse.md | 6 +- docs/TemplateGetResponse.md | 6 +- docs/TemplateListResponse.md | 8 +- docs/TemplateRemoveUserRequest.md | 4 +- docs/TemplateResponse.md | 4 +- docs/TemplateResponseAccount.md | 4 +- docs/TemplateResponseAccountQuota.md | 4 +- docs/TemplateResponseCCRole.md | 4 +- docs/TemplateResponseDocument.md | 4 +- ...TemplateResponseDocumentCustomFieldBase.md | 4 +- ...lateResponseDocumentCustomFieldCheckbox.md | 4 +- ...TemplateResponseDocumentCustomFieldText.md | 4 +- docs/TemplateResponseDocumentFieldGroup.md | 4 +- .../TemplateResponseDocumentFieldGroupRule.md | 4 +- docs/TemplateResponseDocumentFormFieldBase.md | 4 +- ...mplateResponseDocumentFormFieldCheckbox.md | 4 +- ...lateResponseDocumentFormFieldDateSigned.md | 4 +- ...mplateResponseDocumentFormFieldDropdown.md | 4 +- ...plateResponseDocumentFormFieldHyperlink.md | 4 +- ...mplateResponseDocumentFormFieldInitials.md | 4 +- .../TemplateResponseDocumentFormFieldRadio.md | 4 +- ...plateResponseDocumentFormFieldSignature.md | 4 +- docs/TemplateResponseDocumentFormFieldText.md | 6 +- ...TemplateResponseDocumentStaticFieldBase.md | 4 +- ...lateResponseDocumentStaticFieldCheckbox.md | 4 +- ...teResponseDocumentStaticFieldDateSigned.md | 4 +- ...lateResponseDocumentStaticFieldDropdown.md | 4 +- ...ateResponseDocumentStaticFieldHyperlink.md | 4 +- ...lateResponseDocumentStaticFieldInitials.md | 4 +- ...emplateResponseDocumentStaticFieldRadio.md | 4 +- ...ateResponseDocumentStaticFieldSignature.md | 4 +- ...TemplateResponseDocumentStaticFieldText.md | 4 +- docs/TemplateResponseFieldAvgTextLength.md | 4 +- docs/TemplateResponseSignerRole.md | 4 +- docs/TemplateUpdateFilesRequest.md | 4 +- docs/TemplateUpdateFilesResponse.md | 6 +- docs/TemplateUpdateFilesResponseTemplate.md | 4 +- docs/UnclaimedDraftApi.md | 20 +- docs/UnclaimedDraftCreateEmbeddedRequest.md | 6 +- ...dDraftCreateEmbeddedWithTemplateRequest.md | 4 +- docs/UnclaimedDraftCreateRequest.md | 6 +- docs/UnclaimedDraftCreateResponse.md | 6 +- docs/UnclaimedDraftEditAndResendRequest.md | 4 +- docs/UnclaimedDraftResponse.md | 4 +- docs/WarningResponse.md | 4 +- examples/FaxLineAddUser.java | 30 + examples/FaxLineAreaCodeGet.java | 26 + examples/FaxLineCreate.java | 30 + examples/FaxLineDelete.java | 28 + examples/FaxLineGet.java | 26 + examples/FaxLineList.java | 26 + examples/FaxLineRemoveUser.java | 30 + gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 43453 bytes gradle/wrapper/gradle-wrapper.properties | 2 + gradlew | 189 +- gradlew.bat | 37 +- openapi-config.yaml | 11 +- openapi-sdk.yaml | 1080 ++++++++++ pom.xml | 33 +- run-build | 4 +- src/main/java/com/dropbox/sign/ApiClient.java | 106 +- .../java/com/dropbox/sign/ApiException.java | 6 +- .../java/com/dropbox/sign/Configuration.java | 4 +- .../sign/CustomInstantDeserializer.java | 232 --- .../com/dropbox/sign/EventCallbackHelper.java | 2 +- src/main/java/com/dropbox/sign/JSON.java | 33 +- .../com/dropbox/sign/JavaTimeFormatter.java | 8 +- src/main/java/com/dropbox/sign/Pair.java | 2 +- .../com/dropbox/sign/RFC3339DateFormat.java | 5 +- .../com/dropbox/sign/ServerConfiguration.java | 18 +- .../java/com/dropbox/sign/ServerVariable.java | 14 + .../java/com/dropbox/sign/StringUtil.java | 2 +- .../java/com/dropbox/sign/api/AccountApi.java | 220 +-- .../java/com/dropbox/sign/api/ApiAppApi.java | 284 ++- .../com/dropbox/sign/api/BulkSendJobApi.java | 119 +- .../com/dropbox/sign/api/EmbeddedApi.java | 118 +- .../java/com/dropbox/sign/api/FaxLineApi.java | 661 +++++++ .../java/com/dropbox/sign/api/OAuthApi.java | 108 +- .../java/com/dropbox/sign/api/ReportApi.java | 56 +- .../dropbox/sign/api/SignatureRequestApi.java | 905 ++++----- .../java/com/dropbox/sign/api/TeamApi.java | 559 +++--- .../com/dropbox/sign/api/TemplateApi.java | 635 +++--- .../dropbox/sign/api/UnclaimedDraftApi.java | 223 +-- .../com/dropbox/sign/auth/ApiKeyAuth.java | 2 +- .../com/dropbox/sign/auth/HttpBasicAuth.java | 2 +- .../com/dropbox/sign/auth/HttpBearerAuth.java | 2 +- .../sign/model/AbstractOpenApiSchema.java | 4 +- .../sign/model/AccountCreateRequest.java | 26 +- .../sign/model/AccountCreateResponse.java | 29 +- .../sign/model/AccountGetResponse.java | 24 +- .../dropbox/sign/model/AccountResponse.java | 61 +- .../sign/model/AccountResponseQuotas.java | 37 +- .../sign/model/AccountResponseUsage.java | 12 +- .../sign/model/AccountUpdateRequest.java | 21 +- .../sign/model/AccountVerifyRequest.java | 11 +- .../sign/model/AccountVerifyResponse.java | 18 +- .../model/AccountVerifyResponseAccount.java | 11 +- .../sign/model/ApiAppCreateRequest.java | 41 +- .../dropbox/sign/model/ApiAppGetResponse.java | 24 +- .../sign/model/ApiAppListResponse.java | 37 +- .../dropbox/sign/model/ApiAppResponse.java | 59 +- .../sign/model/ApiAppResponseOAuth.java | 29 +- .../sign/model/ApiAppResponseOptions.java | 12 +- .../model/ApiAppResponseOwnerAccount.java | 17 +- .../ApiAppResponseWhiteLabelingOptions.java | 77 +- .../sign/model/ApiAppUpdateRequest.java | 43 +- .../sign/model/BulkSendJobGetResponse.java | 48 +- ...lkSendJobGetResponseSignatureRequests.java | 143 +- .../sign/model/BulkSendJobListResponse.java | 37 +- .../sign/model/BulkSendJobResponse.java | 27 +- .../sign/model/BulkSendJobSendResponse.java | 24 +- .../sign/model/EmbeddedEditUrlRequest.java | 60 +- .../sign/model/EmbeddedEditUrlResponse.java | 24 +- .../EmbeddedEditUrlResponseEmbedded.java | 17 +- .../sign/model/EmbeddedSignUrlResponse.java | 24 +- .../EmbeddedSignUrlResponseEmbedded.java | 17 +- .../com/dropbox/sign/model/ErrorResponse.java | 11 +- .../sign/model/ErrorResponseError.java | 22 +- .../sign/model/EventCallbackRequest.java | 26 +- .../sign/model/EventCallbackRequestEvent.java | 27 +- .../EventCallbackRequestEventMetadata.java | 27 +- .../sign/model/FaxLineAddUserRequest.java | 278 +++ .../model/FaxLineAreaCodeGetCountryEnum.java | 65 + .../model/FaxLineAreaCodeGetProvinceEnum.java | 85 + .../model/FaxLineAreaCodeGetResponse.java | 188 ++ .../model/FaxLineAreaCodeGetStateEnum.java | 161 ++ .../sign/model/FaxLineCreateRequest.java | 365 ++++ .../sign/model/FaxLineDeleteRequest.java | 178 ++ .../sign/model/FaxLineListResponse.java | 291 +++ .../sign/model/FaxLineRemoveUserRequest.java | 278 +++ .../dropbox/sign/model/FaxLineResponse.java | 230 +++ .../sign/model/FaxLineResponseFaxLine.java | 339 ++++ .../com/dropbox/sign/model/FileResponse.java | 28 +- .../sign/model/FileResponseDataUri.java | 17 +- .../dropbox/sign/model/ListInfoResponse.java | 27 +- .../sign/model/OAuthTokenGenerateRequest.java | 31 +- .../sign/model/OAuthTokenRefreshRequest.java | 16 +- .../sign/model/OAuthTokenResponse.java | 31 +- .../sign/model/ReportCreateRequest.java | 21 +- .../sign/model/ReportCreateResponse.java | 24 +- .../dropbox/sign/model/ReportResponse.java | 29 +- ...BulkCreateEmbeddedWithTemplateRequest.java | 79 +- ...ureRequestBulkSendWithTemplateRequest.java | 79 +- ...SignatureRequestCreateEmbeddedRequest.java | 148 +- ...uestCreateEmbeddedWithTemplateRequest.java | 91 +- .../model/SignatureRequestGetResponse.java | 24 +- .../model/SignatureRequestListResponse.java | 37 +- .../model/SignatureRequestRemindRequest.java | 16 +- .../sign/model/SignatureRequestResponse.java | 144 +- .../SignatureRequestResponseAttachment.java | 45 +- ...gnatureRequestResponseCustomFieldBase.java | 37 +- ...ureRequestResponseCustomFieldCheckbox.java | 22 +- ...gnatureRequestResponseCustomFieldText.java | 22 +- ...ureRequestResponseCustomFieldTypeEnum.java | 4 +- .../SignatureRequestResponseDataBase.java | 37 +- .../SignatureRequestResponseDataTypeEnum.java | 4 +- ...atureRequestResponseDataValueCheckbox.java | 21 +- ...RequestResponseDataValueCheckboxMerge.java | 21 +- ...ureRequestResponseDataValueDateSigned.java | 21 +- ...atureRequestResponseDataValueDropdown.java | 21 +- ...atureRequestResponseDataValueInitials.java | 21 +- ...ignatureRequestResponseDataValueRadio.java | 21 +- ...tureRequestResponseDataValueSignature.java | 21 +- ...SignatureRequestResponseDataValueText.java | 21 +- ...tureRequestResponseDataValueTextMerge.java | 21 +- .../SignatureRequestResponseSignatures.java | 102 +- .../model/SignatureRequestSendRequest.java | 161 +- ...gnatureRequestSendWithTemplateRequest.java | 105 +- .../model/SignatureRequestUpdateRequest.java | 26 +- .../com/dropbox/sign/model/SubAttachment.java | 26 +- .../dropbox/sign/model/SubBulkSignerList.java | 20 +- .../model/SubBulkSignerListCustomField.java | 16 +- .../java/com/dropbox/sign/model/SubCC.java | 16 +- .../dropbox/sign/model/SubCustomField.java | 27 +- .../dropbox/sign/model/SubEditorOptions.java | 17 +- .../dropbox/sign/model/SubFieldOptions.java | 12 +- .../dropbox/sign/model/SubFormFieldGroup.java | 21 +- .../dropbox/sign/model/SubFormFieldRule.java | 26 +- .../sign/model/SubFormFieldRuleAction.java | 26 +- .../sign/model/SubFormFieldRuleTrigger.java | 28 +- .../model/SubFormFieldsPerDocumentBase.java | 67 +- .../SubFormFieldsPerDocumentCheckbox.java | 27 +- ...SubFormFieldsPerDocumentCheckboxMerge.java | 17 +- .../SubFormFieldsPerDocumentDateSigned.java | 39 +- .../SubFormFieldsPerDocumentDropdown.java | 49 +- .../SubFormFieldsPerDocumentFontEnum.java | 16 +- .../SubFormFieldsPerDocumentHyperlink.java | 49 +- .../SubFormFieldsPerDocumentInitials.java | 17 +- .../model/SubFormFieldsPerDocumentRadio.java | 27 +- .../SubFormFieldsPerDocumentSignature.java | 17 +- .../model/SubFormFieldsPerDocumentText.java | 79 +- .../SubFormFieldsPerDocumentTextMerge.java | 39 +- .../SubFormFieldsPerDocumentTypeEnum.java | 4 +- .../com/dropbox/sign/model/SubMergeField.java | 16 +- .../java/com/dropbox/sign/model/SubOAuth.java | 19 +- .../com/dropbox/sign/model/SubOptions.java | 12 +- .../SubSignatureRequestGroupedSigners.java | 21 +- .../sign/model/SubSignatureRequestSigner.java | 36 +- .../SubSignatureRequestTemplateSigner.java | 36 +- .../dropbox/sign/model/SubSigningOptions.java | 32 +- .../dropbox/sign/model/SubTeamResponse.java | 16 +- .../dropbox/sign/model/SubTemplateRole.java | 16 +- .../sign/model/SubUnclaimedDraftSigner.java | 21 +- .../SubUnclaimedDraftTemplateSigner.java | 21 +- .../sign/model/SubWhiteLabelingOptions.java | 82 +- .../sign/model/TeamAddMemberRequest.java | 21 +- .../dropbox/sign/model/TeamCreateRequest.java | 11 +- .../sign/model/TeamGetInfoResponse.java | 24 +- .../dropbox/sign/model/TeamGetResponse.java | 24 +- .../dropbox/sign/model/TeamInfoResponse.java | 31 +- .../sign/model/TeamInviteResponse.java | 36 +- .../sign/model/TeamInvitesResponse.java | 26 +- .../sign/model/TeamMemberResponse.java | 21 +- .../sign/model/TeamMembersResponse.java | 37 +- .../sign/model/TeamParentResponse.java | 17 +- .../sign/model/TeamRemoveMemberRequest.java | 31 +- .../com/dropbox/sign/model/TeamResponse.java | 33 +- .../sign/model/TeamSubTeamsResponse.java | 37 +- .../dropbox/sign/model/TeamUpdateRequest.java | 11 +- .../sign/model/TemplateAddUserRequest.java | 21 +- .../TemplateCreateEmbeddedDraftRequest.java | 151 +- .../TemplateCreateEmbeddedDraftResponse.java | 24 +- ...teCreateEmbeddedDraftResponseTemplate.java | 32 +- .../sign/model/TemplateCreateRequest.java | 112 +- .../sign/model/TemplateCreateResponse.java | 24 +- .../model/TemplateCreateResponseTemplate.java | 12 +- .../sign/model/TemplateEditResponse.java | 17 +- .../sign/model/TemplateGetResponse.java | 24 +- .../sign/model/TemplateListResponse.java | 37 +- .../sign/model/TemplateRemoveUserRequest.java | 16 +- .../dropbox/sign/model/TemplateResponse.java | 100 +- .../sign/model/TemplateResponseAccount.java | 36 +- .../model/TemplateResponseAccountQuota.java | 27 +- .../sign/model/TemplateResponseCCRole.java | 11 +- .../sign/model/TemplateResponseDocument.java | 44 +- ...mplateResponseDocumentCustomFieldBase.java | 70 +- ...teResponseDocumentCustomFieldCheckbox.java | 17 +- ...mplateResponseDocumentCustomFieldText.java | 37 +- .../TemplateResponseDocumentFieldGroup.java | 16 +- ...emplateResponseDocumentFieldGroupRule.java | 17 +- ...TemplateResponseDocumentFormFieldBase.java | 70 +- ...lateResponseDocumentFormFieldCheckbox.java | 17 +- ...teResponseDocumentFormFieldDateSigned.java | 17 +- ...lateResponseDocumentFormFieldDropdown.java | 17 +- ...ateResponseDocumentFormFieldHyperlink.java | 37 +- ...lateResponseDocumentFormFieldInitials.java | 17 +- ...emplateResponseDocumentFormFieldRadio.java | 17 +- ...ateResponseDocumentFormFieldSignature.java | 17 +- ...TemplateResponseDocumentFormFieldText.java | 42 +- ...mplateResponseDocumentStaticFieldBase.java | 62 +- ...teResponseDocumentStaticFieldCheckbox.java | 17 +- ...ResponseDocumentStaticFieldDateSigned.java | 17 +- ...teResponseDocumentStaticFieldDropdown.java | 17 +- ...eResponseDocumentStaticFieldHyperlink.java | 17 +- ...teResponseDocumentStaticFieldInitials.java | 17 +- ...plateResponseDocumentStaticFieldRadio.java | 17 +- ...eResponseDocumentStaticFieldSignature.java | 17 +- ...mplateResponseDocumentStaticFieldText.java | 17 +- .../TemplateResponseFieldAvgTextLength.java | 17 +- .../model/TemplateResponseSignerRole.java | 16 +- .../model/TemplateUpdateFilesRequest.java | 40 +- .../model/TemplateUpdateFilesResponse.java | 17 +- .../TemplateUpdateFilesResponseTemplate.java | 22 +- .../UnclaimedDraftCreateEmbeddedRequest.java | 207 +- ...raftCreateEmbeddedWithTemplateRequest.java | 168 +- .../model/UnclaimedDraftCreateRequest.java | 147 +- .../model/UnclaimedDraftCreateResponse.java | 24 +- .../UnclaimedDraftEditAndResendRequest.java | 46 +- .../sign/model/UnclaimedDraftResponse.java | 37 +- .../dropbox/sign/model/WarningResponse.java | 17 +- .../dropbox/sign/EventCallbackHelperTest.java | 18 +- .../java/com/dropbox/sign/FixtureTest.java | 6 +- .../sign/SubFormFieldsPerDocumentTest.java | 13 +- .../com/dropbox/sign/api/AccountApiTest.java | 19 +- .../com/dropbox/sign/api/ApiAppApiTest.java | 13 +- .../dropbox/sign/api/BulkSendJobApiTest.java | 9 +- .../com/dropbox/sign/api/EmbeddedApiTest.java | 9 +- .../com/dropbox/sign/api/OAuthApiTest.java | 9 +- .../com/dropbox/sign/api/ReportApiTest.java | 7 +- .../sign/api/SignatureRequestApiTest.java | 29 +- .../com/dropbox/sign/api/TeamApiTest.java | 15 +- .../com/dropbox/sign/api/TemplateApiTest.java | 17 +- .../sign/api/UnclaimedDraftApiTest.java | 13 +- templates/ApiClient.mustache | 38 +- templates/BeanValidationException.mustache | 6 +- templates/Configuration.mustache | 2 + templates/CustomInstantDeserializer.mustache | 2 + templates/JSON.mustache | 7 - templates/JavaTimeFormatter.mustache | 7 - templates/README.mustache | 223 ++- templates/RFC3339DateFormat.mustache | 5 +- templates/ServerConfiguration.mustache | 7 +- templates/ServerVariable.mustache | 3 + .../additionalOneOfTypeAnnotations.mustache | 2 + templates/api.mustache | 14 +- templates/apiException.mustache | 13 +- templates/api_doc.mustache | 17 + templates/api_test.mustache | 14 +- templates/auth/HttpBasicAuth.mustache | 18 - templates/auth/HttpBearerAuth.mustache | 22 +- templates/auth/OAuthFlow.mustache | 11 +- templates/beanValidation.mustache | 2 + templates/beanValidationQueryParams.mustache | 2 +- templates/build.gradle.mustache | 59 +- templates/generatedAnnotation.mustache | 2 +- templates/gitignore.mustache | 18 +- templates/gradle-wrapper.properties.mustache | 7 + templates/gradle.properties.mustache | 2 + templates/gradlew.bat.mustache | 37 +- templates/gradlew.mustache | 189 +- templates/jackson_annotations.mustache | 17 +- templates/javaBuilder.mustache | 82 + .../apache-httpclient/ApiClient.mustache | 243 ++- .../apache-httpclient/BaseApi.mustache | 110 ++ .../apache-httpclient/README.mustache | 25 +- .../libraries/apache-httpclient/api.mustache | 149 +- .../apache-httpclient/api_test.mustache | 17 +- .../apache-httpclient/build.gradle.mustache | 44 +- .../libraries/apache-httpclient/pom.mustache | 208 +- templates/libraries/feign/ApiClient.mustache | 89 +- .../feign/ApiResponseDecoder.mustache | 13 +- .../libraries/feign/EncodingUtils.mustache | 2 + .../libraries/feign/ParamExpander.mustache | 2 + .../feign/additional_properties.mustache | 45 + templates/libraries/feign/api.mustache | 31 +- templates/libraries/feign/api_test.mustache | 9 +- .../feign/auth/ApiErrorDecoder.mustache | 6 +- .../libraries/feign/auth/ApiKeyAuth.mustache | 2 + .../feign/auth/DefaultApi20Impl.mustache | 2 + .../feign/auth/HttpBasicAuth.mustache | 2 + .../feign/auth/HttpBearerAuth.mustache | 26 +- templates/libraries/feign/auth/OAuth.mustache | 14 +- .../auth/OauthClientCredentialsGrant.mustache | 4 +- .../feign/auth/OauthPasswordGrant.mustache | 6 +- .../libraries/feign/build.gradle.mustache | 40 +- templates/libraries/feign/build.sbt.mustache | 26 +- templates/libraries/feign/model.mustache | 78 + .../feign/model/ApiResponse.mustache | 12 +- templates/libraries/feign/model_test.mustache | 7 - .../pojo.mustache | 477 ++--- templates/libraries/feign/pom.mustache | 98 +- .../google-api-client/ApiClient.mustache | 19 +- .../libraries/google-api-client/api.mustache | 6 +- .../google-api-client/api_test.mustache | 19 +- .../google-api-client/build.gradle.mustache | 34 +- .../google-api-client/build.sbt.mustache | 11 +- .../libraries/google-api-client/pom.mustache | 77 +- .../jersey2/AbstractOpenApiSchema.mustache | 6 +- .../libraries/jersey2/ApiClient.mustache | 358 ++-- templates/libraries/jersey2/JSON.mustache | 72 +- .../jersey2/additional_properties.mustache | 2 +- .../libraries/jersey2/anyof_model.mustache | 16 +- templates/libraries/jersey2/api.mustache | 118 +- .../libraries/jersey2/apiException.mustache | 13 +- templates/libraries/jersey2/api_doc.mustache | 73 +- templates/libraries/jersey2/api_test.mustache | 20 +- .../jersey2/auth/HttpBasicAuth.mustache | 18 - .../libraries/jersey2/auth/OAuth.mustache | 29 +- .../libraries/jersey2/auth/OAuthFlow.mustache | 8 +- .../libraries/jersey2/build.gradle.mustache | 192 +- .../libraries/jersey2/build.sbt.mustache | 26 +- templates/libraries/jersey2/model.mustache | 9 +- .../libraries/jersey2/model_test.mustache | 44 + .../libraries/jersey2/oneof_model.mustache | 114 +- templates/libraries/jersey2/pojo.mustache | 211 +- templates/libraries/jersey2/pom.mustache | 92 +- .../jersey3/AbstractOpenApiSchema.mustache | 2 +- .../libraries/jersey3/ApiClient.mustache | 134 +- templates/libraries/jersey3/JSON.mustache | 32 +- .../libraries/jersey3/anyof_model.mustache | 8 +- templates/libraries/jersey3/api.mustache | 134 +- .../libraries/jersey3/apiException.mustache | 12 +- templates/libraries/jersey3/api_doc.mustache | 84 +- templates/libraries/jersey3/api_test.mustache | 14 +- .../libraries/jersey3/build.gradle.mustache | 127 +- .../libraries/jersey3/build.sbt.mustache | 20 +- .../jersey3/generatedAnnotation.mustache | 2 +- templates/libraries/jersey3/model.mustache | 12 +- .../libraries/jersey3/model_test.mustache | 9 +- .../libraries/jersey3/oneof_model.mustache | 108 +- templates/libraries/jersey3/pojo.mustache | 78 +- templates/libraries/jersey3/pom.mustache | 56 +- .../libraries/microprofile/README.mustache | 11 +- templates/libraries/microprofile/api.mustache | 63 +- .../microprofile/api_exception.mustache | 4 +- .../api_exception_mapper.mustache | 6 +- .../libraries/microprofile/api_test.mustache | 27 +- .../microprofile/beanValidation.mustache | 2 + .../microprofile/client_operation.mustache | 1 + .../libraries/microprofile/enumClass.mustache | 22 +- .../microprofile/enumOuterClass.mustache | 24 +- .../formParamsNameSuffix.mustache | 1 + .../microprofile/generatedAnnotation.mustache | 2 +- .../microprofile/kumuluzee.pom.mustache | 6 +- .../libraries/microprofile/model.mustache | 35 +- .../libraries/microprofile/pojo.mustache | 104 +- templates/libraries/microprofile/pom.mustache | 136 +- .../libraries/microprofile/pom_3.0.mustache | 236 +++ .../microprofile/returnTypes.mustache | 4 - .../microprofile/server_operation.mustache | 1 + .../native/AbstractOpenApiSchema.mustache | 3 +- templates/libraries/native/ApiClient.mustache | 49 +- .../libraries/native/ApiResponse.mustache | 1 + templates/libraries/native/JSON.mustache | 50 +- templates/libraries/native/README.mustache | 23 +- .../native/additional_properties.mustache | 8 +- .../libraries/native/anyof_model.mustache | 168 +- templates/libraries/native/api.mustache | 219 ++- .../libraries/native/apiException.mustache | 2 + templates/libraries/native/api_doc.mustache | 24 +- templates/libraries/native/api_test.mustache | 13 +- .../libraries/native/build.gradle.mustache | 57 +- .../native/generatedAnnotation.mustache | 2 +- templates/libraries/native/model.mustache | 12 +- templates/libraries/native/modelEnum.mustache | 120 ++ .../libraries/native/oneof_model.mustache | 170 +- templates/libraries/native/pojo.mustache | 272 ++- templates/libraries/native/pom.mustache | 120 +- .../okhttp-gson-nextgen/ApiCallback.mustache | 51 - .../okhttp-gson-nextgen/ApiClient.mustache | 1738 ----------------- .../okhttp-gson-nextgen/ApiResponse.mustache | 75 - .../GzipRequestInterceptor.mustache | 74 - .../ProgressRequestBody.mustache | 62 - .../ProgressResponseBody.mustache | 59 - .../okhttp-gson-nextgen/README.mustache | 183 -- .../okhttp-gson-nextgen/anyof_model.mustache | 236 --- .../okhttp-gson-nextgen/api.mustache | 520 ----- .../okhttp-gson-nextgen/apiException.mustache | 199 -- .../okhttp-gson-nextgen/api_doc.mustache | 118 -- .../okhttp-gson-nextgen/api_test.mustache | 56 - .../auth/ApiKeyAuth.mustache | 69 - .../auth/Authentication.mustache | 25 - .../auth/HttpBasicAuth.mustache | 46 - .../auth/HttpBearerAuth.mustache | 52 - .../okhttp-gson-nextgen/auth/OAuth.mustache | 31 - .../auth/OAuthOkHttpClient.mustache | 70 - .../auth/RetryingOAuth.mustache | 213 -- .../okhttp-gson-nextgen/build.gradle.mustache | 169 -- .../okhttp-gson-nextgen/build.sbt.mustache | 39 - .../okhttp-gson-nextgen/model.mustache | 61 - .../okhttp-gson-nextgen/oneof_model.mustache | 242 --- .../okhttp-gson-nextgen/pom.mustache | 420 ---- .../AbstractOpenApiSchema.mustache | 7 +- .../libraries/okhttp-gson/ApiClient.mustache | 341 +++- .../JSON.mustache | 53 +- .../libraries/okhttp-gson/README.mustache | 24 +- .../additional_properties.mustache | 46 + .../okhttp-gson/anyof_model.mustache | 398 ++++ templates/libraries/okhttp-gson/api.mustache | 124 +- .../okhttp-gson/apiException.mustache | 40 +- .../libraries/okhttp-gson/api_doc.mustache | 20 +- .../libraries/okhttp-gson/api_test.mustache | 31 +- .../okhttp-gson/auth/AWS4Auth.mustache | 104 + .../okhttp-gson/auth/HttpBasicAuth.mustache | 2 - .../okhttp-gson/auth/HttpBearerAuth.mustache | 20 +- .../auth/OAuthOkHttpClient.mustache | 3 + .../okhttp-gson/auth/RetryingOAuth.mustache | 60 +- .../okhttp-gson/build.gradle.mustache | 56 +- .../libraries/okhttp-gson/build.sbt.mustache | 30 +- .../libraries/okhttp-gson/model.mustache | 35 + .../libraries/okhttp-gson/modelEnum.mustache | 85 + .../okhttp-gson/modelInnerEnum.mustache | 66 + .../libraries/okhttp-gson/model_test.mustache | 42 + .../okhttp-gson/oneof_model.mustache | 512 +++++ templates/libraries/okhttp-gson/pojo.mustache | 591 ++++++ templates/libraries/okhttp-gson/pom.mustache | 115 +- .../libraries/rest-assured/ApiClient.mustache | 3 - .../rest-assured/JacksonObjectMapper.mustache | 19 +- templates/libraries/rest-assured/api.mustache | 41 +- .../libraries/rest-assured/api_doc.mustache | 14 +- .../libraries/rest-assured/api_test.mustache | 22 +- .../rest-assured/build.gradle.mustache | 54 +- .../libraries/rest-assured/build.sbt.mustache | 36 +- templates/libraries/rest-assured/pom.mustache | 74 +- .../libraries/restclient/ApiClient.mustache | 756 +++++++ .../libraries/restclient/README.mustache | 216 ++ templates/libraries/restclient/api.mustache | 185 ++ .../libraries/restclient/api_test.mustache | 40 + .../restclient/auth/ApiKeyAuth.mustache | 64 + .../restclient/auth/Authentication.mustache | 16 + .../restclient/auth/HttpBasicAuth.mustache | 40 + .../restclient/auth/HttpBearerAuth.mustache | 58 + .../libraries/restclient/auth/OAuth.mustache | 26 + .../restclient/auth/OAuthFlow.mustache | 7 + .../restclient/build.gradle.mustache | 159 ++ .../{retrofit => restclient}/pom.mustache | 193 +- .../libraries/resteasy/ApiClient.mustache | 101 +- templates/libraries/resteasy/JSON.mustache | 4 +- templates/libraries/resteasy/api.mustache | 12 +- .../libraries/resteasy/build.gradle.mustache | 18 +- .../libraries/resteasy/build.sbt.mustache | 13 +- templates/libraries/resteasy/pom.mustache | 56 +- .../libraries/resttemplate/ApiClient.mustache | 171 +- .../libraries/resttemplate/BaseApi.mustache | 76 + templates/libraries/resttemplate/api.mustache | 94 +- .../libraries/resttemplate/api_test.mustache | 25 +- .../resttemplate/auth/ApiKeyAuth.mustache | 2 + .../resttemplate/auth/Authentication.mustache | 2 + .../resttemplate/auth/HttpBasicAuth.mustache | 7 +- .../resttemplate/auth/HttpBearerAuth.mustache | 34 +- .../resttemplate/auth/OAuth.mustache | 38 +- .../resttemplate/auth/OAuthFlow.mustache | 2 + .../resttemplate/build.gradle.mustache | 87 +- templates/libraries/resttemplate/pom.mustache | 188 +- .../libraries/retrofit/ApiClient.mustache | 448 ----- .../retrofit/CollectionFormats.mustache | 99 - templates/libraries/retrofit/README.mustache | 42 - templates/libraries/retrofit/api.mustache | 74 - .../libraries/retrofit/api_test.mustache | 44 - .../retrofit/auth/ApiKeyAuth.mustache | 72 - .../retrofit/auth/HttpBasicAuth.mustache | 49 - .../retrofit/auth/HttpBearerAuth.mustache | 42 - .../libraries/retrofit/auth/OAuth.mustache | 185 -- .../retrofit/auth/OAuthOkHttpClient.mustache | 69 - .../libraries/retrofit/bodyParams.mustache | 1 - .../libraries/retrofit/build.gradle.mustache | 130 -- .../libraries/retrofit/build.sbt.mustache | 24 - .../libraries/retrofit/formParams.mustache | 1 - .../libraries/retrofit/headerParams.mustache | 1 - .../libraries/retrofit/pathParams.mustache | 1 - .../libraries/retrofit/queryParams.mustache | 1 - .../libraries/retrofit2/ApiClient.mustache | 42 +- .../retrofit2/CollectionFormats.mustache | 2 + templates/libraries/retrofit2/JSON.mustache | 7 - .../libraries/retrofit2/JSON_jackson.mustache | 263 +++ templates/libraries/retrofit2/api.mustache | 8 +- .../libraries/retrofit2/api_test.mustache | 16 +- .../retrofit2/auth/ApiKeyAuth.mustache | 2 + .../retrofit2/auth/HttpBasicAuth.mustache | 2 + .../retrofit2/auth/HttpBearerAuth.mustache | 2 + .../libraries/retrofit2/auth/OAuth.mustache | 10 +- .../retrofit2/auth/OAuthOkHttpClient.mustache | 2 + .../libraries/retrofit2/build.gradle.mustache | 58 +- .../libraries/retrofit2/build.sbt.mustache | 27 +- .../retrofit2/play24/ApiClient.mustache | 6 +- .../play24/Play24CallAdapterFactory.mustache | 2 + .../play24/Play24CallFactory.mustache | 2 + .../libraries/retrofit2/play24/api.mustache | 2 - .../retrofit2/play25/ApiClient.mustache | 6 +- .../play25/Play25CallAdapterFactory.mustache | 2 + .../play25/Play25CallFactory.mustache | 2 + .../libraries/retrofit2/play25/api.mustache | 2 - .../retrofit2/play26/ApiClient.mustache | 6 +- .../play26/Play26CallAdapterFactory.mustache | 2 + .../play26/Play26CallFactory.mustache | 2 + .../libraries/retrofit2/play26/api.mustache | 7 +- templates/libraries/retrofit2/pom.mustache | 96 +- templates/libraries/vertx/ApiClient.mustache | 43 +- .../libraries/vertx/Configuration.mustache | 3 + .../libraries/vertx/apiException.mustache | 2 + templates/libraries/vertx/api_test.mustache | 32 +- .../libraries/vertx/build.gradle.mustache | 20 +- templates/libraries/vertx/pom.mustache | 57 +- .../libraries/webclient/ApiClient.mustache | 18 +- templates/libraries/webclient/api.mustache | 59 +- .../libraries/webclient/api_test.mustache | 19 +- .../webclient/auth/ApiKeyAuth.mustache | 2 + .../webclient/auth/Authentication.mustache | 2 + .../webclient/auth/HttpBasicAuth.mustache | 7 +- .../webclient/auth/HttpBearerAuth.mustache | 6 +- .../libraries/webclient/auth/OAuth.mustache | 2 + .../webclient/auth/OAuthFlow.mustache | 2 + .../libraries/webclient/build.gradle.mustache | 85 +- templates/libraries/webclient/pom.mustache | 60 +- .../maven.yml => templates/maven.yml.mustache | 9 +- templates/model.mustache | 33 +- templates/modelEnum.mustache | 30 +- templates/modelInnerEnum.mustache | 8 +- templates/model_test.mustache | 19 +- templates/oneof_interface.mustache | 2 +- templates/pojo.mustache | 354 +++- templates/pojo_doc.mustache | 24 +- templates/pom.mustache | 108 +- templates/typeInfoAnnotation.mustache | 18 +- 728 files changed, 20970 insertions(+), 16597 deletions(-) delete mode 100644 .openapi-generator/FILES delete mode 100644 .openapi-generator/VERSION 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.java create mode 100644 examples/FaxLineAreaCodeGet.java create mode 100644 examples/FaxLineCreate.java create mode 100644 examples/FaxLineDelete.java create mode 100644 examples/FaxLineGet.java create mode 100644 examples/FaxLineList.java create mode 100644 examples/FaxLineRemoveUser.java delete mode 100644 src/main/java/com/dropbox/sign/CustomInstantDeserializer.java create mode 100644 src/main/java/com/dropbox/sign/api/FaxLineApi.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineListResponse.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineResponse.java create mode 100644 src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java create mode 100644 templates/additionalOneOfTypeAnnotations.mustache create mode 100644 templates/javaBuilder.mustache create mode 100644 templates/libraries/apache-httpclient/BaseApi.mustache create mode 100644 templates/libraries/feign/additional_properties.mustache create mode 100644 templates/libraries/feign/model.mustache rename templates/libraries/{okhttp-gson-nextgen => feign}/pojo.mustache (54%) create mode 100644 templates/libraries/jersey2/model_test.mustache create mode 100644 templates/libraries/microprofile/client_operation.mustache create mode 100644 templates/libraries/microprofile/formParamsNameSuffix.mustache create mode 100644 templates/libraries/microprofile/pom_3.0.mustache delete mode 100644 templates/libraries/microprofile/returnTypes.mustache create mode 100644 templates/libraries/microprofile/server_operation.mustache create mode 100644 templates/libraries/native/modelEnum.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/ApiClient.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/README.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/anyof_model.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/api.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/apiException.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/api_doc.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/api_test.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/build.gradle.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/build.sbt.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/model.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/oneof_model.mustache delete mode 100644 templates/libraries/okhttp-gson-nextgen/pom.mustache rename templates/libraries/{okhttp-gson-nextgen => okhttp-gson}/AbstractOpenApiSchema.mustache (94%) rename templates/libraries/{okhttp-gson-nextgen => okhttp-gson}/JSON.mustache (93%) create mode 100644 templates/libraries/okhttp-gson/additional_properties.mustache create mode 100644 templates/libraries/okhttp-gson/anyof_model.mustache create mode 100644 templates/libraries/okhttp-gson/auth/AWS4Auth.mustache create mode 100644 templates/libraries/okhttp-gson/model.mustache create mode 100644 templates/libraries/okhttp-gson/modelEnum.mustache create mode 100644 templates/libraries/okhttp-gson/modelInnerEnum.mustache create mode 100644 templates/libraries/okhttp-gson/model_test.mustache create mode 100644 templates/libraries/okhttp-gson/oneof_model.mustache create mode 100644 templates/libraries/okhttp-gson/pojo.mustache create mode 100644 templates/libraries/restclient/ApiClient.mustache create mode 100644 templates/libraries/restclient/README.mustache create mode 100644 templates/libraries/restclient/api.mustache create mode 100644 templates/libraries/restclient/api_test.mustache create mode 100644 templates/libraries/restclient/auth/ApiKeyAuth.mustache create mode 100644 templates/libraries/restclient/auth/Authentication.mustache create mode 100644 templates/libraries/restclient/auth/HttpBasicAuth.mustache create mode 100644 templates/libraries/restclient/auth/HttpBearerAuth.mustache create mode 100644 templates/libraries/restclient/auth/OAuth.mustache create mode 100644 templates/libraries/restclient/auth/OAuthFlow.mustache create mode 100644 templates/libraries/restclient/build.gradle.mustache rename templates/libraries/{retrofit => restclient}/pom.mustache (60%) create mode 100644 templates/libraries/resttemplate/BaseApi.mustache delete mode 100644 templates/libraries/retrofit/ApiClient.mustache delete mode 100644 templates/libraries/retrofit/CollectionFormats.mustache delete mode 100644 templates/libraries/retrofit/README.mustache delete mode 100644 templates/libraries/retrofit/api.mustache delete mode 100644 templates/libraries/retrofit/api_test.mustache delete mode 100644 templates/libraries/retrofit/auth/ApiKeyAuth.mustache delete mode 100644 templates/libraries/retrofit/auth/HttpBasicAuth.mustache delete mode 100644 templates/libraries/retrofit/auth/HttpBearerAuth.mustache delete mode 100644 templates/libraries/retrofit/auth/OAuth.mustache delete mode 100644 templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache delete mode 100644 templates/libraries/retrofit/bodyParams.mustache delete mode 100644 templates/libraries/retrofit/build.gradle.mustache delete mode 100644 templates/libraries/retrofit/build.sbt.mustache delete mode 100644 templates/libraries/retrofit/formParams.mustache delete mode 100644 templates/libraries/retrofit/headerParams.mustache delete mode 100644 templates/libraries/retrofit/pathParams.mustache delete mode 100644 templates/libraries/retrofit/queryParams.mustache create mode 100644 templates/libraries/retrofit2/JSON_jackson.mustache rename .github/workflows/maven.yml => templates/maven.yml.mustache (84%) diff --git a/.gitignore b/.gitignore index b6717f0..639e150 100644 --- a/.gitignore +++ b/.gitignore @@ -18,12 +18,10 @@ hs_err_pid* **/target target .gradle -build/ +build -.composer -vendor - -# Intellij -.idea/ - -.openapi-generator +/.composer +/vendor +/.idea/ +/.openapi-generator +/.github/workflows/maven.yml diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index f46211b..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,397 +0,0 @@ -.github/workflows/maven.yml -.gitignore -.travis.yml -README.md -VERSION -build.gradle -build.sbt -docs/AccountApi.md -docs/AccountCreateRequest.md -docs/AccountCreateResponse.md -docs/AccountGetResponse.md -docs/AccountResponse.md -docs/AccountResponseQuotas.md -docs/AccountResponseUsage.md -docs/AccountUpdateRequest.md -docs/AccountVerifyRequest.md -docs/AccountVerifyResponse.md -docs/AccountVerifyResponseAccount.md -docs/ApiAppApi.md -docs/ApiAppCreateRequest.md -docs/ApiAppGetResponse.md -docs/ApiAppListResponse.md -docs/ApiAppResponse.md -docs/ApiAppResponseOAuth.md -docs/ApiAppResponseOptions.md -docs/ApiAppResponseOwnerAccount.md -docs/ApiAppResponseWhiteLabelingOptions.md -docs/ApiAppUpdateRequest.md -docs/BulkSendJobApi.md -docs/BulkSendJobGetResponse.md -docs/BulkSendJobGetResponseSignatureRequests.md -docs/BulkSendJobListResponse.md -docs/BulkSendJobResponse.md -docs/BulkSendJobSendResponse.md -docs/EmbeddedApi.md -docs/EmbeddedEditUrlRequest.md -docs/EmbeddedEditUrlResponse.md -docs/EmbeddedEditUrlResponseEmbedded.md -docs/EmbeddedSignUrlResponse.md -docs/EmbeddedSignUrlResponseEmbedded.md -docs/ErrorResponse.md -docs/ErrorResponseError.md -docs/EventCallbackRequest.md -docs/EventCallbackRequestEvent.md -docs/EventCallbackRequestEventMetadata.md -docs/FileResponse.md -docs/FileResponseDataUri.md -docs/ListInfoResponse.md -docs/OAuthApi.md -docs/OAuthTokenGenerateRequest.md -docs/OAuthTokenRefreshRequest.md -docs/OAuthTokenResponse.md -docs/ReportApi.md -docs/ReportCreateRequest.md -docs/ReportCreateResponse.md -docs/ReportResponse.md -docs/SignatureRequestApi.md -docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md -docs/SignatureRequestBulkSendWithTemplateRequest.md -docs/SignatureRequestCreateEmbeddedRequest.md -docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md -docs/SignatureRequestGetResponse.md -docs/SignatureRequestListResponse.md -docs/SignatureRequestRemindRequest.md -docs/SignatureRequestResponse.md -docs/SignatureRequestResponseAttachment.md -docs/SignatureRequestResponseCustomFieldBase.md -docs/SignatureRequestResponseCustomFieldCheckbox.md -docs/SignatureRequestResponseCustomFieldText.md -docs/SignatureRequestResponseCustomFieldTypeEnum.md -docs/SignatureRequestResponseDataBase.md -docs/SignatureRequestResponseDataTypeEnum.md -docs/SignatureRequestResponseDataValueCheckbox.md -docs/SignatureRequestResponseDataValueCheckboxMerge.md -docs/SignatureRequestResponseDataValueDateSigned.md -docs/SignatureRequestResponseDataValueDropdown.md -docs/SignatureRequestResponseDataValueInitials.md -docs/SignatureRequestResponseDataValueRadio.md -docs/SignatureRequestResponseDataValueSignature.md -docs/SignatureRequestResponseDataValueText.md -docs/SignatureRequestResponseDataValueTextMerge.md -docs/SignatureRequestResponseSignatures.md -docs/SignatureRequestSendRequest.md -docs/SignatureRequestSendWithTemplateRequest.md -docs/SignatureRequestUpdateRequest.md -docs/SubAttachment.md -docs/SubBulkSignerList.md -docs/SubBulkSignerListCustomField.md -docs/SubCC.md -docs/SubCustomField.md -docs/SubEditorOptions.md -docs/SubFieldOptions.md -docs/SubFormFieldGroup.md -docs/SubFormFieldRule.md -docs/SubFormFieldRuleAction.md -docs/SubFormFieldRuleTrigger.md -docs/SubFormFieldsPerDocumentBase.md -docs/SubFormFieldsPerDocumentCheckbox.md -docs/SubFormFieldsPerDocumentCheckboxMerge.md -docs/SubFormFieldsPerDocumentDateSigned.md -docs/SubFormFieldsPerDocumentDropdown.md -docs/SubFormFieldsPerDocumentFontEnum.md -docs/SubFormFieldsPerDocumentHyperlink.md -docs/SubFormFieldsPerDocumentInitials.md -docs/SubFormFieldsPerDocumentRadio.md -docs/SubFormFieldsPerDocumentSignature.md -docs/SubFormFieldsPerDocumentText.md -docs/SubFormFieldsPerDocumentTextMerge.md -docs/SubFormFieldsPerDocumentTypeEnum.md -docs/SubMergeField.md -docs/SubOAuth.md -docs/SubOptions.md -docs/SubSignatureRequestGroupedSigners.md -docs/SubSignatureRequestSigner.md -docs/SubSignatureRequestTemplateSigner.md -docs/SubSigningOptions.md -docs/SubTeamResponse.md -docs/SubTemplateRole.md -docs/SubUnclaimedDraftSigner.md -docs/SubUnclaimedDraftTemplateSigner.md -docs/SubWhiteLabelingOptions.md -docs/TeamAddMemberRequest.md -docs/TeamApi.md -docs/TeamCreateRequest.md -docs/TeamGetInfoResponse.md -docs/TeamGetResponse.md -docs/TeamInfoResponse.md -docs/TeamInviteResponse.md -docs/TeamInvitesResponse.md -docs/TeamMemberResponse.md -docs/TeamMembersResponse.md -docs/TeamParentResponse.md -docs/TeamRemoveMemberRequest.md -docs/TeamResponse.md -docs/TeamSubTeamsResponse.md -docs/TeamUpdateRequest.md -docs/TemplateAddUserRequest.md -docs/TemplateApi.md -docs/TemplateCreateEmbeddedDraftRequest.md -docs/TemplateCreateEmbeddedDraftResponse.md -docs/TemplateCreateEmbeddedDraftResponseTemplate.md -docs/TemplateCreateRequest.md -docs/TemplateCreateResponse.md -docs/TemplateCreateResponseTemplate.md -docs/TemplateEditResponse.md -docs/TemplateGetResponse.md -docs/TemplateListResponse.md -docs/TemplateRemoveUserRequest.md -docs/TemplateResponse.md -docs/TemplateResponseAccount.md -docs/TemplateResponseAccountQuota.md -docs/TemplateResponseCCRole.md -docs/TemplateResponseDocument.md -docs/TemplateResponseDocumentCustomFieldBase.md -docs/TemplateResponseDocumentCustomFieldCheckbox.md -docs/TemplateResponseDocumentCustomFieldText.md -docs/TemplateResponseDocumentFieldGroup.md -docs/TemplateResponseDocumentFieldGroupRule.md -docs/TemplateResponseDocumentFormFieldBase.md -docs/TemplateResponseDocumentFormFieldCheckbox.md -docs/TemplateResponseDocumentFormFieldDateSigned.md -docs/TemplateResponseDocumentFormFieldDropdown.md -docs/TemplateResponseDocumentFormFieldHyperlink.md -docs/TemplateResponseDocumentFormFieldInitials.md -docs/TemplateResponseDocumentFormFieldRadio.md -docs/TemplateResponseDocumentFormFieldSignature.md -docs/TemplateResponseDocumentFormFieldText.md -docs/TemplateResponseDocumentStaticFieldBase.md -docs/TemplateResponseDocumentStaticFieldCheckbox.md -docs/TemplateResponseDocumentStaticFieldDateSigned.md -docs/TemplateResponseDocumentStaticFieldDropdown.md -docs/TemplateResponseDocumentStaticFieldHyperlink.md -docs/TemplateResponseDocumentStaticFieldInitials.md -docs/TemplateResponseDocumentStaticFieldRadio.md -docs/TemplateResponseDocumentStaticFieldSignature.md -docs/TemplateResponseDocumentStaticFieldText.md -docs/TemplateResponseFieldAvgTextLength.md -docs/TemplateResponseSignerRole.md -docs/TemplateUpdateFilesRequest.md -docs/TemplateUpdateFilesResponse.md -docs/TemplateUpdateFilesResponseTemplate.md -docs/UnclaimedDraftApi.md -docs/UnclaimedDraftCreateEmbeddedRequest.md -docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md -docs/UnclaimedDraftCreateRequest.md -docs/UnclaimedDraftCreateResponse.md -docs/UnclaimedDraftEditAndResendRequest.md -docs/UnclaimedDraftResponse.md -docs/WarningResponse.md -gradle.properties -gradle/wrapper/gradle-wrapper.jar -gradle/wrapper/gradle-wrapper.properties -gradlew -gradlew.bat -pom.xml -settings.gradle -src/main/AndroidManifest.xml -src/main/java/com/dropbox/sign/ApiClient.java -src/main/java/com/dropbox/sign/ApiException.java -src/main/java/com/dropbox/sign/ApiResponse.java -src/main/java/com/dropbox/sign/Configuration.java -src/main/java/com/dropbox/sign/CustomInstantDeserializer.java -src/main/java/com/dropbox/sign/EventCallbackHelper.java -src/main/java/com/dropbox/sign/JSON.java -src/main/java/com/dropbox/sign/JavaTimeFormatter.java -src/main/java/com/dropbox/sign/Pair.java -src/main/java/com/dropbox/sign/RFC3339DateFormat.java -src/main/java/com/dropbox/sign/ServerConfiguration.java -src/main/java/com/dropbox/sign/ServerVariable.java -src/main/java/com/dropbox/sign/StringUtil.java -src/main/java/com/dropbox/sign/api/AccountApi.java -src/main/java/com/dropbox/sign/api/ApiAppApi.java -src/main/java/com/dropbox/sign/api/BulkSendJobApi.java -src/main/java/com/dropbox/sign/api/EmbeddedApi.java -src/main/java/com/dropbox/sign/api/OAuthApi.java -src/main/java/com/dropbox/sign/api/ReportApi.java -src/main/java/com/dropbox/sign/api/SignatureRequestApi.java -src/main/java/com/dropbox/sign/api/TeamApi.java -src/main/java/com/dropbox/sign/api/TemplateApi.java -src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java -src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java -src/main/java/com/dropbox/sign/auth/Authentication.java -src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java -src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java -src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java -src/main/java/com/dropbox/sign/model/AccountCreateRequest.java -src/main/java/com/dropbox/sign/model/AccountCreateResponse.java -src/main/java/com/dropbox/sign/model/AccountGetResponse.java -src/main/java/com/dropbox/sign/model/AccountResponse.java -src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java -src/main/java/com/dropbox/sign/model/AccountResponseUsage.java -src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java -src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java -src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java -src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java -src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java -src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java -src/main/java/com/dropbox/sign/model/ApiAppListResponse.java -src/main/java/com/dropbox/sign/model/ApiAppResponse.java -src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java -src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java -src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java -src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java -src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java -src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java -src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java -src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java -src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java -src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java -src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java -src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java -src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java -src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java -src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java -src/main/java/com/dropbox/sign/model/ErrorResponse.java -src/main/java/com/dropbox/sign/model/ErrorResponseError.java -src/main/java/com/dropbox/sign/model/EventCallbackRequest.java -src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java -src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java -src/main/java/com/dropbox/sign/model/FileResponse.java -src/main/java/com/dropbox/sign/model/FileResponseDataUri.java -src/main/java/com/dropbox/sign/model/ListInfoResponse.java -src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java -src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java -src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java -src/main/java/com/dropbox/sign/model/ReportCreateRequest.java -src/main/java/com/dropbox/sign/model/ReportCreateResponse.java -src/main/java/com/dropbox/sign/model/ReportResponse.java -src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java -src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java -src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java -src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java -src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java -src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java -src/main/java/com/dropbox/sign/model/SubAttachment.java -src/main/java/com/dropbox/sign/model/SubBulkSignerList.java -src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java -src/main/java/com/dropbox/sign/model/SubCC.java -src/main/java/com/dropbox/sign/model/SubCustomField.java -src/main/java/com/dropbox/sign/model/SubEditorOptions.java -src/main/java/com/dropbox/sign/model/SubFieldOptions.java -src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java -src/main/java/com/dropbox/sign/model/SubFormFieldRule.java -src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java -src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java -src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java -src/main/java/com/dropbox/sign/model/SubMergeField.java -src/main/java/com/dropbox/sign/model/SubOAuth.java -src/main/java/com/dropbox/sign/model/SubOptions.java -src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java -src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java -src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java -src/main/java/com/dropbox/sign/model/SubSigningOptions.java -src/main/java/com/dropbox/sign/model/SubTeamResponse.java -src/main/java/com/dropbox/sign/model/SubTemplateRole.java -src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java -src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java -src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java -src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java -src/main/java/com/dropbox/sign/model/TeamCreateRequest.java -src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java -src/main/java/com/dropbox/sign/model/TeamGetResponse.java -src/main/java/com/dropbox/sign/model/TeamInfoResponse.java -src/main/java/com/dropbox/sign/model/TeamInviteResponse.java -src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java -src/main/java/com/dropbox/sign/model/TeamMemberResponse.java -src/main/java/com/dropbox/sign/model/TeamMembersResponse.java -src/main/java/com/dropbox/sign/model/TeamParentResponse.java -src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java -src/main/java/com/dropbox/sign/model/TeamResponse.java -src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java -src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java -src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java -src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java -src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java -src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java -src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java -src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java -src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java -src/main/java/com/dropbox/sign/model/TemplateEditResponse.java -src/main/java/com/dropbox/sign/model/TemplateGetResponse.java -src/main/java/com/dropbox/sign/model/TemplateListResponse.java -src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java -src/main/java/com/dropbox/sign/model/TemplateResponse.java -src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java -src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java -src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java -src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java -src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java -src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java -src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java -src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java -src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java -src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java -src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java -src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java -src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java -src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java -src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java -src/main/java/com/dropbox/sign/model/WarningResponse.java diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index 73a86b1..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.1 \ No newline at end of file diff --git a/README.md b/README.md index aa955fb..5fdc708 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Add this dependency to your project's POM: com.dropbox.sign dropbox-sign - 2.1.0 + 2.2.0 compile ``` @@ -72,7 +72,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.dropbox.sign:dropbox-sign:2.1.0" + implementation "com.dropbox.sign:dropbox-sign:2.2.0" } ``` @@ -86,7 +86,7 @@ mvn clean package Then manually install the following JARs: -- `target/dropbox-sign-2.1.0.jar` +- `target/dropbox-sign-2.2.0.jar` - `target/lib/*.jar` ## Getting Started @@ -133,32 +133,6 @@ public class Example { ``` - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import com.dropbox.sign.*; - import com.dropbox.sign.api.AccountApi; - - ... - - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); - - AccountApi apiInstance = new AccountApi(defaultClient); - - ``` - ## Documentation for API Endpoints @@ -179,6 +153,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 @@ -261,6 +242,17 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [FaxLineListResponse](docs/FaxLineListResponse.md) + - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [FaxLineResponse](docs/FaxLineResponse.md) + - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -401,18 +393,22 @@ Class | Method | HTTP request | Description - [WarningResponse](docs/WarningResponse.md) + ## Documentation for Authorization + Authentication schemes defined for the API: + ### api_key - **Type**: HTTP basic authentication + ### oauth2 -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ## Recommendation @@ -429,7 +425,7 @@ apisupport@hellosign.com This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `2.1.0` + - Package version: `2.2.0` - Build package: `org.openapitools.codegen.languages.JavaClientCodegen` diff --git a/VERSION b/VERSION index 7ec1d6d..ccbccc3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 +2.2.0 diff --git a/build.gradle b/build.gradle index c419793..bce8eb6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,4 @@ + buildscript { repositories { mavenCentral() @@ -20,7 +21,7 @@ apply plugin: 'signing' group = 'com.dropbox.sign' archivesBaseName = 'dropbox-sign' -version = '2.1.0' +version = '2.2.0' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -116,12 +117,11 @@ publishing { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jakarta_annotation_version = "2.1.0" - jackson_threetenbp_version = "2.9.10" jersey_version = "3.0.4" - junit_version = "4.13.1" + junit_version = "5.8.2" mockito_version = "3.12.4" } @@ -137,12 +137,16 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.mockito:mockito-core:$mockito_version" } +test { + useJUnitPlatform() +} javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] diff --git a/build.sbt b/build.sbt index 651ac38..e3cd984 100644 --- a/build.sbt +++ b/build.sbt @@ -2,13 +2,14 @@ lazy val root = (project in file(".")). settings( organization := "com.dropbox.sign", name := "dropbox-sign", - version := "2.1.0", + version := "2.2.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), Compile / javacOptions ++= Seq("-Xlint:deprecation"), Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( + libraryDependencies += "commons-codec" % "commons-codec" % "1.15" "com.google.code.findbugs" % "jsr305" % "3.0.0", "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "3.0.4", @@ -16,12 +17,11 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", - "junit" % "junit" % "4.13.2" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 6f258c3..494853d 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**accountCreate**](AccountApi.md#accountCreate) | **POST** /account/create | Create Account [**accountGet**](AccountApi.md#accountGet) | **GET** /account | Get Account [**accountUpdate**](AccountApi.md#accountUpdate) | **PUT** /account | Update Account @@ -62,8 +62,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountCreateRequest** | [**AccountCreateRequest**](AccountCreateRequest.md)| | ### Return type @@ -134,8 +134,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. | [optional] **emailAddress** | **String**| `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. | [optional] @@ -210,8 +210,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountUpdateRequest** | [**AccountUpdateRequest**](AccountUpdateRequest.md)| | ### Return type @@ -285,8 +285,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountVerifyRequest** | [**AccountVerifyRequest**](AccountVerifyRequest.md)| | ### Return type diff --git a/docs/AccountCreateRequest.md b/docs/AccountCreateRequest.md index a10ed08..9c75292 100644 --- a/docs/AccountCreateRequest.md +++ b/docs/AccountCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```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) | | | `clientSecret` | ```String``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | diff --git a/docs/AccountCreateResponse.md b/docs/AccountCreateResponse.md index 59279d1..7e09def 100644 --- a/docs/AccountCreateResponse.md +++ b/docs/AccountCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauthData` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/AccountGetResponse.md b/docs/AccountGetResponse.md index 41508ab..f5ed78b 100644 --- a/docs/AccountGetResponse.md +++ b/docs/AccountGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/AccountResponse.md b/docs/AccountResponse.md index e763487..5b73aa0 100644 --- a/docs/AccountResponse.md +++ b/docs/AccountResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The ID of the Account | | | `emailAddress` | ```String``` | The email address associated with the Account. | | | `isLocked` | ```Boolean``` | Returns `true` if the user has been locked out of their account by a team admin. | | diff --git a/docs/AccountResponseQuotas.md b/docs/AccountResponseQuotas.md index c591ff8..3b7fe4e 100644 --- a/docs/AccountResponseQuotas.md +++ b/docs/AccountResponseQuotas.md @@ -6,8 +6,8 @@ Details concerning remaining monthly quotas. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `apiSignatureRequestsLeft` | ```Integer``` | API signature requests remaining. | | | `documentsLeft` | ```Integer``` | Signature requests remaining. | | | `templatesTotal` | ```Integer``` | Total API templates allowed. | | diff --git a/docs/AccountResponseUsage.md b/docs/AccountResponseUsage.md index f9f3671..1cdb766 100644 --- a/docs/AccountResponseUsage.md +++ b/docs/AccountResponseUsage.md @@ -6,8 +6,8 @@ Details concerning monthly usage ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `faxPagesSent` | ```Integer``` | Number of fax pages sent | | diff --git a/docs/AccountUpdateRequest.md b/docs/AccountUpdateRequest.md index d1dac21..43121c8 100644 --- a/docs/AccountUpdateRequest.md +++ b/docs/AccountUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The ID of the Account | | | `callbackUrl` | ```String``` | The URL that Dropbox Sign should POST events to. | | | `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. | | diff --git a/docs/AccountVerifyRequest.md b/docs/AccountVerifyRequest.md index de912c5..d14a8eb 100644 --- a/docs/AccountVerifyRequest.md +++ b/docs/AccountVerifyRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | Email address to run the verification for. | | diff --git a/docs/AccountVerifyResponse.md b/docs/AccountVerifyResponse.md index 07f01ff..8868f15 100644 --- a/docs/AccountVerifyResponse.md +++ b/docs/AccountVerifyResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `account` | [```AccountVerifyResponseAccount```](AccountVerifyResponseAccount.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/AccountVerifyResponseAccount.md b/docs/AccountVerifyResponseAccount.md index efa24dc..f83f9f0 100644 --- a/docs/AccountVerifyResponseAccount.md +++ b/docs/AccountVerifyResponseAccount.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress` | ```String``` | The email address associated with the Account. | | diff --git a/docs/ApiAppApi.md b/docs/ApiAppApi.md index a22cd2e..02630c9 100644 --- a/docs/ApiAppApi.md +++ b/docs/ApiAppApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**apiAppCreate**](ApiAppApi.md#apiAppCreate) | **POST** /api_app | Create API App [**apiAppDelete**](ApiAppApi.md#apiAppDelete) | **DELETE** /api_app/{client_id} | Delete API App [**apiAppGet**](ApiAppApi.md#apiAppGet) | **GET** /api_app/{client_id} | Get API App @@ -80,8 +80,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **apiAppCreateRequest** | [**ApiAppCreateRequest**](ApiAppCreateRequest.md)| | ### Return type @@ -152,8 +152,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to delete. | ### Return type @@ -226,8 +226,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to retrieve. | ### Return type @@ -301,8 +301,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **page** | **Integer**| Which page number of the API App List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -396,8 +396,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to update. | **apiAppUpdateRequest** | [**ApiAppUpdateRequest**](ApiAppUpdateRequest.md)| | diff --git a/docs/ApiAppCreateRequest.md b/docs/ApiAppCreateRequest.md index 59c2028..b787bc7 100644 --- a/docs/ApiAppCreateRequest.md +++ b/docs/ApiAppCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `domains`*_required_ | ```List``` | The domain names the ApiApp will be associated with. | | | `name`*_required_ | ```String``` | The name you want to assign to the ApiApp. | | | `callbackUrl` | ```String``` | The URL at which the ApiApp should receive event callbacks. | | diff --git a/docs/ApiAppGetResponse.md b/docs/ApiAppGetResponse.md index b90c30a..98e2f98 100644 --- a/docs/ApiAppGetResponse.md +++ b/docs/ApiAppGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `apiApp` | [```ApiAppResponse```](ApiAppResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `apiApp`*_required_ | [```ApiAppResponse```](ApiAppResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/ApiAppListResponse.md b/docs/ApiAppListResponse.md index 144b0f4..14c287f 100644 --- a/docs/ApiAppListResponse.md +++ b/docs/ApiAppListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `apiApps` | [```List```](ApiAppResponse.md) | Contains information about API Apps. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `apiApps`*_required_ | [```List```](ApiAppResponse.md) | Contains information about API Apps. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/ApiAppResponse.md b/docs/ApiAppResponse.md index bb0836d..afe95c8 100644 --- a/docs/ApiAppResponse.md +++ b/docs/ApiAppResponse.md @@ -6,8 +6,8 @@ Contains information about an API App. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The app's callback URL (for events) | | | `clientId` | ```String``` | The app's client id | | | `createdAt` | ```Integer``` | The time that the app was created | | diff --git a/docs/ApiAppResponseOAuth.md b/docs/ApiAppResponseOAuth.md index 20c678a..c2f705c 100644 --- a/docs/ApiAppResponseOAuth.md +++ b/docs/ApiAppResponseOAuth.md @@ -6,8 +6,8 @@ An object describing the app's OAuth properties, or null if OAuth is not con ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The app's OAuth callback URL. | | | `secret` | ```String``` | The app's OAuth secret, or null if the app does not belong to user. | | | `scopes` | ```List``` | Array of OAuth scopes used by the app. | | diff --git a/docs/ApiAppResponseOptions.md b/docs/ApiAppResponseOptions.md index 827b3b5..07979f3 100644 --- a/docs/ApiAppResponseOptions.md +++ b/docs/ApiAppResponseOptions.md @@ -6,8 +6,8 @@ An object with options that override account settings. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `canInsertEverywhere` | ```Boolean``` | Boolean denoting if signers can "Insert Everywhere" in one click while signing a document | | diff --git a/docs/ApiAppResponseOwnerAccount.md b/docs/ApiAppResponseOwnerAccount.md index 0ac35ee..b4d6d42 100644 --- a/docs/ApiAppResponseOwnerAccount.md +++ b/docs/ApiAppResponseOwnerAccount.md @@ -6,8 +6,8 @@ An object describing the app's owner ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The owner account's ID | | | `emailAddress` | ```String``` | The owner account's email address | | diff --git a/docs/ApiAppResponseWhiteLabelingOptions.md b/docs/ApiAppResponseWhiteLabelingOptions.md index 1ed534a..be6d022 100644 --- a/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/docs/ApiAppResponseWhiteLabelingOptions.md @@ -6,8 +6,8 @@ An object with options to customize the app's signer page ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `headerBackgroundColor` | ```String``` | | | | `legalVersion` | ```String``` | | | | `linkColor` | ```String``` | | | diff --git a/docs/ApiAppUpdateRequest.md b/docs/ApiAppUpdateRequest.md index 62bc8fd..1c0efaf 100644 --- a/docs/ApiAppUpdateRequest.md +++ b/docs/ApiAppUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The URL at which the API App should receive event callbacks. | | | `customLogoFile` | ```File``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | | `domains` | ```List``` | The domain names the ApiApp will be associated with. | | diff --git a/docs/BulkSendJobApi.md b/docs/BulkSendJobApi.md index c369376..5d7335a 100644 --- a/docs/BulkSendJobApi.md +++ b/docs/BulkSendJobApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**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 @@ -59,8 +59,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **bulkSendJobId** | **String**| The id of the BulkSendJob to retrieve. | **page** | **Integer**| Which page number of the BulkSendJob list to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. | [optional] [default to 20] @@ -136,8 +136,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **page** | **Integer**| Which page number of the BulkSendJob List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. | [optional] [default to 20] diff --git a/docs/BulkSendJobGetResponse.md b/docs/BulkSendJobGetResponse.md index 977a108..93395ee 100644 --- a/docs/BulkSendJobGetResponse.md +++ b/docs/BulkSendJobGetResponse.md @@ -6,11 +6,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signatureRequests` | [```List```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signatureRequests`*_required_ | [```List```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/BulkSendJobGetResponseSignatureRequests.md b/docs/BulkSendJobGetResponseSignatureRequests.md index 8cf2c0b..ba283af 100644 --- a/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/docs/BulkSendJobGetResponseSignatureRequests.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `testMode` | ```Boolean``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | | | `signatureRequestId` | ```String``` | The id of the SignatureRequest. | | | `requesterEmailAddress` | ```String``` | The email address of the initiator of the SignatureRequest. | | diff --git a/docs/BulkSendJobListResponse.md b/docs/BulkSendJobListResponse.md index f0ef7df..e5eb231 100644 --- a/docs/BulkSendJobListResponse.md +++ b/docs/BulkSendJobListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJobs` | [```List```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJobs`*_required_ | [```List```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/BulkSendJobResponse.md b/docs/BulkSendJobResponse.md index c97fb3d..eb2278a 100644 --- a/docs/BulkSendJobResponse.md +++ b/docs/BulkSendJobResponse.md @@ -6,8 +6,8 @@ Contains information about the BulkSendJob such as when it was created and how m ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `bulkSendJobId` | ```String``` | The id of the BulkSendJob. | | | `total` | ```Integer``` | The total amount of Signature Requests queued for sending. | | | `isCreator` | ```Boolean``` | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | | diff --git a/docs/BulkSendJobSendResponse.md b/docs/BulkSendJobSendResponse.md index 9ca5095..532b64b 100644 --- a/docs/BulkSendJobSendResponse.md +++ b/docs/BulkSendJobSendResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/EmbeddedApi.md b/docs/EmbeddedApi.md index 7ea121b..62955f9 100644 --- a/docs/EmbeddedApi.md +++ b/docs/EmbeddedApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**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 @@ -65,8 +65,8 @@ public class Main { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template to edit. | **embeddedEditUrlRequest** | [**EmbeddedEditUrlRequest**](EmbeddedEditUrlRequest.md)| | @@ -140,8 +140,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureId** | **String**| The id of the signature to get a signature url for. | ### Return type diff --git a/docs/EmbeddedEditUrlRequest.md b/docs/EmbeddedEditUrlRequest.md index 3026512..4e2d8c2 100644 --- a/docs/EmbeddedEditUrlRequest.md +++ b/docs/EmbeddedEditUrlRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `allowEditCcs` | ```Boolean``` | This allows the requester to enable/disable to add or change CC roles when editing the template. | | | `ccRoles` | ```List``` | 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. | | | `editorOptions` | [```SubEditorOptions```](SubEditorOptions.md) | | | diff --git a/docs/EmbeddedEditUrlResponse.md b/docs/EmbeddedEditUrlResponse.md index ec2ce55..959e0c7 100644 --- a/docs/EmbeddedEditUrlResponse.md +++ b/docs/EmbeddedEditUrlResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/EmbeddedEditUrlResponseEmbedded.md b/docs/EmbeddedEditUrlResponseEmbedded.md index 6406555..78ad702 100644 --- a/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/docs/EmbeddedEditUrlResponseEmbedded.md @@ -6,8 +6,8 @@ An embedded template object. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `editUrl` | ```String``` | A template url that can be opened in an iFrame. | | | `expiresAt` | ```Integer``` | The specific time that the the `edit_url` link expires, in epoch. | | diff --git a/docs/EmbeddedSignUrlResponse.md b/docs/EmbeddedSignUrlResponse.md index a6f119c..6f39b97 100644 --- a/docs/EmbeddedSignUrlResponse.md +++ b/docs/EmbeddedSignUrlResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/EmbeddedSignUrlResponseEmbedded.md b/docs/EmbeddedSignUrlResponseEmbedded.md index 4f3a834..b2fd6c9 100644 --- a/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/docs/EmbeddedSignUrlResponseEmbedded.md @@ -6,8 +6,8 @@ An object that contains necessary information to set up embedded signing. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signUrl` | ```String``` | A signature url that can be opened in an iFrame. | | | `expiresAt` | ```Integer``` | The specific time that the the `sign_url` link expires, in epoch. | | diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index e3153c6..f1a560c 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `error`*_required_ | [```ErrorResponseError```](ErrorResponseError.md) | | | diff --git a/docs/ErrorResponseError.md b/docs/ErrorResponseError.md index 91f1e8e..656aa5c 100644 --- a/docs/ErrorResponseError.md +++ b/docs/ErrorResponseError.md @@ -6,8 +6,8 @@ Contains information about an error that occurred. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `errorMsg`*_required_ | ```String``` | Message describing an error. | | | `errorName`*_required_ | ```String``` | Name of the error. | | | `errorPath` | ```String``` | Path at which an error occurred. | | diff --git a/docs/EventCallbackRequest.md b/docs/EventCallbackRequest.md index 9286aec..73daf94 100644 --- a/docs/EventCallbackRequest.md +++ b/docs/EventCallbackRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `event`*_required_ | [```EventCallbackRequestEvent```](EventCallbackRequestEvent.md) | | | | `account` | [```AccountResponse```](AccountResponse.md) | | | | `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | diff --git a/docs/EventCallbackRequestEvent.md b/docs/EventCallbackRequestEvent.md index 1e71c97..19ab491 100644 --- a/docs/EventCallbackRequestEvent.md +++ b/docs/EventCallbackRequestEvent.md @@ -6,8 +6,8 @@ Basic information about the event that occurred. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `eventTime`*_required_ | ```String``` | Time the event was created (using Unix time). | | | `eventType`*_required_ | [```EventTypeEnum```](#EventTypeEnum) | Type of callback event that was triggered. | | | `eventHash`*_required_ | ```String``` | Generated hash used to verify source of event data. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: EventTypeEnum -Name | Value +| Name | Value | ---- | ----- | ACCOUNT_CONFIRMED | "account_confirmed" | | UNKNOWN_ERROR | "unknown_error" | diff --git a/docs/EventCallbackRequestEventMetadata.md b/docs/EventCallbackRequestEventMetadata.md index c8a911f..13208c2 100644 --- a/docs/EventCallbackRequestEventMetadata.md +++ b/docs/EventCallbackRequestEventMetadata.md @@ -6,8 +6,8 @@ Specific metadata about the event. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `relatedSignatureId` | ```String``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | | `reportedForAccountId` | ```String``` | Account ID the event was reported for. | | | `reportedForAppId` | ```String``` | App ID the event was reported for. | | diff --git a/docs/FaxLineAddUserRequest.md b/docs/FaxLineAddUserRequest.md new file mode 100644 index 0000000..1c9e997 --- /dev/null +++ b/docs/FaxLineAddUserRequest.md @@ -0,0 +1,16 @@ + + +# FaxLineAddUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `accountId` | ```String``` | Account ID | | +| `emailAddress` | ```String``` | Email address | | + + + diff --git a/docs/FaxLineApi.md b/docs/FaxLineApi.md new file mode 100644 index 0000000..1997f1f --- /dev/null +++ b/docs/FaxLineApi.md @@ -0,0 +1,504 @@ +# 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) + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineAddUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineAddUser(data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### 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 | - | + + +## faxLineAreaCodeGet + +> FaxLineAreaCodeGetResponse faxLineAreaCodeGet(country, state, province, city) + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineAreaCodeGetResponse result = faxLineApi.faxLineAreaCodeGet("US", "CA"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **country** | **String**| Filter area codes by country. | [enum: CA, US, UK] + **state** | **String**| Filter area codes by state. | [optional] [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] + **province** | **String**| Filter area codes by province. | [optional] [enum: AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT] + **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 | - | + + +## faxLineCreate + +> FaxLineResponse faxLineCreate(faxLineCreateRequest) + +Purchase Fax Line + +Purchases a new Fax Line. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxLineResponse result = faxLineApi.faxLineCreate(data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### 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 | - | + + +## faxLineDelete + +> faxLineDelete(faxLineDeleteRequest) + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineDeleteRequest() + .number("[FAX_NUMBER]"); + + try { + faxLineApi.faxLineDelete(data); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **faxLineDeleteRequest** | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md)| | + +### Return type + +null (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 | - | + + +## faxLineGet + +> FaxLineResponse faxLineGet(number) + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineResponse result = faxLineApi.faxLineGet("[FAX_NUMBER]"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### 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 | - | + + +## faxLineList + +> FaxLineListResponse faxLineList(accountId, page, pageSize, showTeamLines) + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineListResponse result = faxLineApi.faxLineList(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **accountId** | **String**| Account ID | [optional] + **page** | **Integer**| Page | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] + **showTeamLines** | **Boolean**| 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 | - | + + +## faxLineRemoveUser + +> FaxLineResponse faxLineRemoveUser(faxLineRemoveUserRequest) + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineRemoveUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineRemoveUser(data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### 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 | - | + diff --git a/docs/FaxLineAreaCodeGetCountryEnum.md b/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 0000000..10275bc --- /dev/null +++ b/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,15 @@ + + +# FaxLineAreaCodeGetCountryEnum + +## Enum + + +* `CA` (value: `"CA"`) + +* `US` (value: `"US"`) + +* `UK` (value: `"UK"`) + + + diff --git a/docs/FaxLineAreaCodeGetProvinceEnum.md b/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 0000000..13cf500 --- /dev/null +++ b/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,35 @@ + + +# FaxLineAreaCodeGetProvinceEnum + +## Enum + + +* `AB` (value: `"AB"`) + +* `BC` (value: `"BC"`) + +* `MB` (value: `"MB"`) + +* `NB` (value: `"NB"`) + +* `NL` (value: `"NL"`) + +* `NT` (value: `"NT"`) + +* `NS` (value: `"NS"`) + +* `NU` (value: `"NU"`) + +* `ON` (value: `"ON"`) + +* `PE` (value: `"PE"`) + +* `QC` (value: `"QC"`) + +* `SK` (value: `"SK"`) + +* `YT` (value: `"YT"`) + + + diff --git a/docs/FaxLineAreaCodeGetResponse.md b/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 0000000..0026193 --- /dev/null +++ b/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,14 @@ + + +# FaxLineAreaCodeGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `areaCodes`*_required_ | ```List``` | | | + + + diff --git a/docs/FaxLineAreaCodeGetStateEnum.md b/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 0000000..577a48c --- /dev/null +++ b/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,111 @@ + + +# FaxLineAreaCodeGetStateEnum + +## Enum + + +* `AK` (value: `"AK"`) + +* `AL` (value: `"AL"`) + +* `AR` (value: `"AR"`) + +* `AZ` (value: `"AZ"`) + +* `CA` (value: `"CA"`) + +* `CO` (value: `"CO"`) + +* `CT` (value: `"CT"`) + +* `DC` (value: `"DC"`) + +* `DE` (value: `"DE"`) + +* `FL` (value: `"FL"`) + +* `GA` (value: `"GA"`) + +* `HI` (value: `"HI"`) + +* `IA` (value: `"IA"`) + +* `ID` (value: `"ID"`) + +* `IL` (value: `"IL"`) + +* `IN` (value: `"IN"`) + +* `KS` (value: `"KS"`) + +* `KY` (value: `"KY"`) + +* `LA` (value: `"LA"`) + +* `MA` (value: `"MA"`) + +* `MD` (value: `"MD"`) + +* `ME` (value: `"ME"`) + +* `MI` (value: `"MI"`) + +* `MN` (value: `"MN"`) + +* `MO` (value: `"MO"`) + +* `MS` (value: `"MS"`) + +* `MT` (value: `"MT"`) + +* `NC` (value: `"NC"`) + +* `ND` (value: `"ND"`) + +* `NE` (value: `"NE"`) + +* `NH` (value: `"NH"`) + +* `NJ` (value: `"NJ"`) + +* `NM` (value: `"NM"`) + +* `NV` (value: `"NV"`) + +* `NY` (value: `"NY"`) + +* `OH` (value: `"OH"`) + +* `OK` (value: `"OK"`) + +* `OR` (value: `"OR"`) + +* `PA` (value: `"PA"`) + +* `RI` (value: `"RI"`) + +* `SC` (value: `"SC"`) + +* `SD` (value: `"SD"`) + +* `TN` (value: `"TN"`) + +* `TX` (value: `"TX"`) + +* `UT` (value: `"UT"`) + +* `VA` (value: `"VA"`) + +* `VT` (value: `"VT"`) + +* `WA` (value: `"WA"`) + +* `WI` (value: `"WI"`) + +* `WV` (value: `"WV"`) + +* `WY` (value: `"WY"`) + + + diff --git a/docs/FaxLineCreateRequest.md b/docs/FaxLineCreateRequest.md new file mode 100644 index 0000000..da9ba39 --- /dev/null +++ b/docs/FaxLineCreateRequest.md @@ -0,0 +1,27 @@ + + +# FaxLineCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `areaCode`*_required_ | ```Integer``` | Area code | | +| `country`*_required_ | [```CountryEnum```](#CountryEnum) | Country | | +| `city` | ```String``` | City | | +| `accountId` | ```String``` | Account ID | | + + + +## Enum: CountryEnum + +| Name | Value | +---- | ----- +| CA | "CA" | +| US | "US" | +| UK | "UK" | + + + diff --git a/docs/FaxLineDeleteRequest.md b/docs/FaxLineDeleteRequest.md new file mode 100644 index 0000000..de1748f --- /dev/null +++ b/docs/FaxLineDeleteRequest.md @@ -0,0 +1,14 @@ + + +# FaxLineDeleteRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | + + + diff --git a/docs/FaxLineListResponse.md b/docs/FaxLineListResponse.md new file mode 100644 index 0000000..69891dc --- /dev/null +++ b/docs/FaxLineListResponse.md @@ -0,0 +1,16 @@ + + +# FaxLineListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `faxLines`*_required_ | [```List```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/docs/FaxLineRemoveUserRequest.md b/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 0000000..51d81b8 --- /dev/null +++ b/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,16 @@ + + +# FaxLineRemoveUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `accountId` | ```String``` | Account ID | | +| `emailAddress` | ```String``` | Email address | | + + + diff --git a/docs/FaxLineResponse.md b/docs/FaxLineResponse.md new file mode 100644 index 0000000..c5256bb --- /dev/null +++ b/docs/FaxLineResponse.md @@ -0,0 +1,15 @@ + + +# FaxLineResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxLine`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/docs/FaxLineResponseFaxLine.md b/docs/FaxLineResponseFaxLine.md new file mode 100644 index 0000000..daf0d20 --- /dev/null +++ b/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,17 @@ + + +# FaxLineResponseFaxLine + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number` | ```String``` | Number | | +| `createdAt` | ```Integer``` | Created at | | +| `updatedAt` | ```Integer``` | Updated at | | +| `accounts` | [```List```](AccountResponse.md) | | | + + + diff --git a/docs/FileResponse.md b/docs/FileResponse.md index 4851cb4..058a80e 100644 --- a/docs/FileResponse.md +++ b/docs/FileResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `fileUrl` | ```String``` | URL to the file. | | -| `expiresAt` | ```Integer``` | When the link expires. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fileUrl`*_required_ | ```String``` | URL to the file. | | +| `expiresAt`*_required_ | ```Integer``` | When the link expires. | | diff --git a/docs/FileResponseDataUri.md b/docs/FileResponseDataUri.md index 1950223..65c0b7d 100644 --- a/docs/FileResponseDataUri.md +++ b/docs/FileResponseDataUri.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `dataUri` | ```String``` | File as base64 encoded string. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `dataUri`*_required_ | ```String``` | File as base64 encoded string. | | diff --git a/docs/ListInfoResponse.md b/docs/ListInfoResponse.md index 02063e7..b9d464e 100644 --- a/docs/ListInfoResponse.md +++ b/docs/ListInfoResponse.md @@ -6,8 +6,8 @@ Contains pagination information about the data returned. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `numPages` | ```Integer``` | Total number of pages available. | | | `numResults` | ```Integer``` | Total number of objects available. | | | `page` | ```Integer``` | Number of the page being returned. | | diff --git a/docs/OAuthApi.md b/docs/OAuthApi.md index 466367a..533052b 100644 --- a/docs/OAuthApi.md +++ b/docs/OAuthApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**oauthTokenGenerate**](OAuthApi.md#oauthTokenGenerate) | **POST** /oauth/token | OAuth Token Generate [**oauthTokenRefresh**](OAuthApi.md#oauthTokenRefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh @@ -56,8 +56,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **oauthTokenGenerateRequest** | [**OAuthTokenGenerateRequest**](OAuthTokenGenerateRequest.md)| | ### Return type @@ -123,8 +123,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **oauthTokenRefreshRequest** | [**OAuthTokenRefreshRequest**](OAuthTokenRefreshRequest.md)| | ### Return type diff --git a/docs/OAuthTokenGenerateRequest.md b/docs/OAuthTokenGenerateRequest.md index 7f376db..45ad0b0 100644 --- a/docs/OAuthTokenGenerateRequest.md +++ b/docs/OAuthTokenGenerateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | The client id of the app requesting authorization. | | | `clientSecret`*_required_ | ```String``` | The secret token of your app. | | | `code`*_required_ | ```String``` | The code passed to your callback when the user granted access. | | diff --git a/docs/OAuthTokenRefreshRequest.md b/docs/OAuthTokenRefreshRequest.md index b88bb9e..2b985fa 100644 --- a/docs/OAuthTokenRefreshRequest.md +++ b/docs/OAuthTokenRefreshRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `grantType`*_required_ | ```String``` | When refreshing an existing token use `refresh_token`. | | | `refreshToken`*_required_ | ```String``` | The token provided when you got the expired access token. | | diff --git a/docs/OAuthTokenResponse.md b/docs/OAuthTokenResponse.md index 28da620..86824cc 100644 --- a/docs/OAuthTokenResponse.md +++ b/docs/OAuthTokenResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accessToken` | ```String``` | | | | `tokenType` | ```String``` | | | | `refreshToken` | ```String``` | | | diff --git a/docs/ReportApi.md b/docs/ReportApi.md index e6af8fa..e0a4097 100644 --- a/docs/ReportApi.md +++ b/docs/ReportApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**reportCreate**](ReportApi.md#reportCreate) | **POST** /report/create | Create Report @@ -68,8 +68,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **reportCreateRequest** | [**ReportCreateRequest**](ReportCreateRequest.md)| | ### Return type diff --git a/docs/ReportCreateRequest.md b/docs/ReportCreateRequest.md index 99053df..d2f4b67 100644 --- a/docs/ReportCreateRequest.md +++ b/docs/ReportCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `endDate`*_required_ | ```String``` | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | | | `reportType`*_required_ | [```List<ReportTypeEnum>```](#List<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`*_required_ | ```String``` | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: List<ReportTypeEnum> -Name | Value +| Name | Value | ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | diff --git a/docs/ReportCreateResponse.md b/docs/ReportCreateResponse.md index 9f8c117..9fc8565 100644 --- a/docs/ReportCreateResponse.md +++ b/docs/ReportCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `report` | [```ReportResponse```](ReportResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `report`*_required_ | [```ReportResponse```](ReportResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/ReportResponse.md b/docs/ReportResponse.md index ade5b63..b48dde6 100644 --- a/docs/ReportResponse.md +++ b/docs/ReportResponse.md @@ -6,8 +6,8 @@ Contains information about the report request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `success` | ```String``` | A message indicating the requested operation's success | | | `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. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: List<ReportTypeEnum> -Name | Value +| Name | Value | ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | diff --git a/docs/SignatureRequestApi.md b/docs/SignatureRequestApi.md index f8e0100..ee42461 100644 --- a/docs/SignatureRequestApi.md +++ b/docs/SignatureRequestApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**signatureRequestBulkCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestBulkCreateEmbeddedWithTemplate) | **POST** /signature_request/bulk_create_embedded_with_template | Embedded Bulk Send with Template [**signatureRequestBulkSendWithTemplate**](SignatureRequestApi.md#signatureRequestBulkSendWithTemplate) | **POST** /signature_request/bulk_send_with_template | Bulk Send with Template [**signatureRequestCancel**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request @@ -115,8 +115,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestBulkCreateEmbeddedWithTemplateRequest** | [**SignatureRequestBulkCreateEmbeddedWithTemplateRequest**](SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -231,8 +231,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestBulkSendWithTemplateRequest** | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md)| | ### Return type @@ -311,8 +311,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the incomplete SignatureRequest to cancel. | ### Return type @@ -414,8 +414,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestCreateEmbeddedRequest** | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md)| | ### Return type @@ -508,8 +508,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestCreateEmbeddedWithTemplateRequest** | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -585,8 +585,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | **fileType** | **String**| Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional] [default to pdf] [enum: pdf, zip] @@ -662,8 +662,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | ### Return type @@ -738,8 +738,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | **forceDownload** | **Integer**| By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. | [optional] [default to 1] @@ -813,8 +813,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | ### Return type @@ -897,8 +897,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] **page** | **Integer**| Which page number of the SignatureRequest List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -974,8 +974,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to release. | ### Return type @@ -1053,8 +1053,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to send a reminder for. | **signatureRequestRemindRequest** | [**SignatureRequestRemindRequest**](SignatureRequestRemindRequest.md)| | @@ -1130,8 +1130,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to remove. | ### Return type @@ -1238,8 +1238,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestSendRequest** | [**SignatureRequestSendRequest**](SignatureRequestSendRequest.md)| | ### Return type @@ -1344,8 +1344,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestSendWithTemplateRequest** | [**SignatureRequestSendWithTemplateRequest**](SignatureRequestSendWithTemplateRequest.md)| | ### Return type @@ -1426,8 +1426,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to update. | **signatureRequestUpdateRequest** | [**SignatureRequestUpdateRequest**](SignatureRequestUpdateRequest.md)| | diff --git a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index fae117a..4243ead 100644 --- a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `signerFile` | ```File``` | `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 ``` | | diff --git a/docs/SignatureRequestBulkSendWithTemplateRequest.md b/docs/SignatureRequestBulkSendWithTemplateRequest.md index e573522..1798f6f 100644 --- a/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `signerFile` | ```File``` | `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 ``` | | | `signerList` | [```List```](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. | | diff --git a/docs/SignatureRequestCreateEmbeddedRequest.md b/docs/SignatureRequestCreateEmbeddedRequest.md index fcfd185..383f8a8 100644 --- a/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/docs/SignatureRequestCreateEmbeddedRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `fileUrls` | ```List``` | 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. | | diff --git a/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index a4dd8ce..050a7e6 100644 --- a/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | diff --git a/docs/SignatureRequestGetResponse.md b/docs/SignatureRequestGetResponse.md index 7ce17ba..25ce665 100644 --- a/docs/SignatureRequestGetResponse.md +++ b/docs/SignatureRequestGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `signatureRequest`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/SignatureRequestListResponse.md b/docs/SignatureRequestListResponse.md index 94fb156..6384d2a 100644 --- a/docs/SignatureRequestListResponse.md +++ b/docs/SignatureRequestListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `signatureRequests` | [```List```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `signatureRequests`*_required_ | [```List```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/SignatureRequestRemindRequest.md b/docs/SignatureRequestRemindRequest.md index 1a16fc5..bf76e08 100644 --- a/docs/SignatureRequestRemindRequest.md +++ b/docs/SignatureRequestRemindRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```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. | | diff --git a/docs/SignatureRequestResponse.md b/docs/SignatureRequestResponse.md index 50ae417..2c9efa5 100644 --- a/docs/SignatureRequestResponse.md +++ b/docs/SignatureRequestResponse.md @@ -6,8 +6,8 @@ Contains information about a signature request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `testMode` | ```Boolean``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | | | `signatureRequestId` | ```String``` | The id of the SignatureRequest. | | | `requesterEmailAddress` | ```String``` | The email address of the initiator of the SignatureRequest. | | diff --git a/docs/SignatureRequestResponseAttachment.md b/docs/SignatureRequestResponseAttachment.md index 23267b6..1ef3a20 100644 --- a/docs/SignatureRequestResponseAttachment.md +++ b/docs/SignatureRequestResponseAttachment.md @@ -6,8 +6,8 @@ Signer attachments. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | The unique ID for this attachment. | | | `signer`*_required_ | ```String``` | The Signer this attachment is assigned to. | | | `name`*_required_ | ```String``` | The name of this attachment. | | diff --git a/docs/SignatureRequestResponseCustomFieldBase.md b/docs/SignatureRequestResponseCustomFieldBase.md index 7dbca6c..7b5f104 100644 --- a/docs/SignatureRequestResponseCustomFieldBase.md +++ b/docs/SignatureRequestResponseCustomFieldBase.md @@ -9,8 +9,8 @@ An array of Custom Field objects containing the name and type of each custom fie ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `name`*_required_ | ```String``` | The name of the Custom Field. | | | `required` | ```Boolean``` | A boolean value denoting if this field is required. | | diff --git a/docs/SignatureRequestResponseCustomFieldCheckbox.md b/docs/SignatureRequestResponseCustomFieldCheckbox.md index e0f8e10..c2cb841 100644 --- a/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `value` | ```Boolean``` | A true/false for checkbox fields | | diff --git a/docs/SignatureRequestResponseCustomFieldText.md b/docs/SignatureRequestResponseCustomFieldText.md index c78e24d..23ceb56 100644 --- a/docs/SignatureRequestResponseCustomFieldText.md +++ b/docs/SignatureRequestResponseCustomFieldText.md @@ -6,8 +6,8 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `value` | ```String``` | A text string for text fields | | diff --git a/docs/SignatureRequestResponseDataBase.md b/docs/SignatureRequestResponseDataBase.md index 7504c49..a9605a4 100644 --- a/docs/SignatureRequestResponseDataBase.md +++ b/docs/SignatureRequestResponseDataBase.md @@ -6,8 +6,8 @@ An array of form field objects containing the name, value, and type of each text ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `apiId` | ```String``` | The unique ID for this field. | | | `signatureId` | ```String``` | The ID of the signature to which this response is linked. | | | `name` | ```String``` | The name of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueCheckbox.md b/docs/SignatureRequestResponseDataValueCheckbox.md index 972c48d..fda5704 100644 --- a/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/docs/SignatureRequestResponseDataValueCheckbox.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A yes/no checkbox | | | `value` | ```Boolean``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueCheckboxMerge.md b/docs/SignatureRequestResponseDataValueCheckboxMerge.md index 6abdf96..96af5eb 100644 --- a/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A checkbox field that has default value set by the api | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueDateSigned.md b/docs/SignatureRequestResponseDataValueDateSigned.md index 2b9e5a7..308bd8b 100644 --- a/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/docs/SignatureRequestResponseDataValueDateSigned.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A date | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueDropdown.md b/docs/SignatureRequestResponseDataValueDropdown.md index 8b5a0f1..599cb3c 100644 --- a/docs/SignatureRequestResponseDataValueDropdown.md +++ b/docs/SignatureRequestResponseDataValueDropdown.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for dropdowns | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueInitials.md b/docs/SignatureRequestResponseDataValueInitials.md index f1d0453..7f82d74 100644 --- a/docs/SignatureRequestResponseDataValueInitials.md +++ b/docs/SignatureRequestResponseDataValueInitials.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for initials | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueRadio.md b/docs/SignatureRequestResponseDataValueRadio.md index 2897f89..b8e073f 100644 --- a/docs/SignatureRequestResponseDataValueRadio.md +++ b/docs/SignatureRequestResponseDataValueRadio.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for radios | | | `value` | ```Boolean``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueSignature.md b/docs/SignatureRequestResponseDataValueSignature.md index bb7ce7f..910932c 100644 --- a/docs/SignatureRequestResponseDataValueSignature.md +++ b/docs/SignatureRequestResponseDataValueSignature.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A signature input field | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueText.md b/docs/SignatureRequestResponseDataValueText.md index 837f27c..e08ec8f 100644 --- a/docs/SignatureRequestResponseDataValueText.md +++ b/docs/SignatureRequestResponseDataValueText.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A text input field | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseDataValueTextMerge.md b/docs/SignatureRequestResponseDataValueTextMerge.md index 60349e2..2b5e0d3 100644 --- a/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/docs/SignatureRequestResponseDataValueTextMerge.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A text field that has default text set by the api | | | `value` | ```String``` | The value of the form field. | | diff --git a/docs/SignatureRequestResponseSignatures.md b/docs/SignatureRequestResponseSignatures.md index 3eac9df..2f0e16d 100644 --- a/docs/SignatureRequestResponseSignatures.md +++ b/docs/SignatureRequestResponseSignatures.md @@ -6,8 +6,8 @@ An array of signature objects, 1 for each signer. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureId` | ```String``` | Signature identifier. | | | `signerGroupGuid` | ```String``` | Signer Group GUID | | | `signerEmailAddress` | ```String``` | The email address of the signer. | | diff --git a/docs/SignatureRequestSendRequest.md b/docs/SignatureRequestSendRequest.md index 5b156ef..9143039 100644 --- a/docs/SignatureRequestSendRequest.md +++ b/docs/SignatureRequestSendRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | | diff --git a/docs/SignatureRequestSendWithTemplateRequest.md b/docs/SignatureRequestSendWithTemplateRequest.md index 5ccd15d..7a8d8c8 100644 --- a/docs/SignatureRequestSendWithTemplateRequest.md +++ b/docs/SignatureRequestSendWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | diff --git a/docs/SignatureRequestUpdateRequest.md b/docs/SignatureRequestUpdateRequest.md index 4e11595..4b38c53 100644 --- a/docs/SignatureRequestUpdateRequest.md +++ b/docs/SignatureRequestUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureId`*_required_ | ```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. | | | `name` | ```String``` | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | | diff --git a/docs/SubAttachment.md b/docs/SubAttachment.md index a7e00e0..b5e9c80 100644 --- a/docs/SubAttachment.md +++ b/docs/SubAttachment.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of attachment. | | | `signerIndex`*_required_ | ```Integer``` | 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. | | diff --git a/docs/SubBulkSignerList.md b/docs/SubBulkSignerList.md index 043abbb..918c935 100644 --- a/docs/SubBulkSignerList.md +++ b/docs/SubBulkSignerList.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `customFields` | [```List```](SubBulkSignerListCustomField.md) | An array of custom field values. | | | `signers` | [```List```](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. | | diff --git a/docs/SubBulkSignerListCustomField.md b/docs/SubBulkSignerListCustomField.md index 2a7c9c0..b37ad53 100644 --- a/docs/SubBulkSignerListCustomField.md +++ b/docs/SubBulkSignerListCustomField.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the custom field. Must be the field's `name` or `api_id`. | | | `value`*_required_ | ```String``` | The value of the custom field. | | diff --git a/docs/SubCC.md b/docs/SubCC.md index 4f59a76..37eacd3 100644 --- a/docs/SubCC.md +++ b/docs/SubCC.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | | | `emailAddress`*_required_ | ```String``` | The email address of the CC recipient. | | diff --git a/docs/SubCustomField.md b/docs/SubCustomField.md index b65f804..a309fd6 100644 --- a/docs/SubCustomField.md +++ b/docs/SubCustomField.md @@ -10,8 +10,8 @@ For using pre-filled on repeatable signature requests, merge fields are added to ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```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. | | | `required` | ```Boolean``` | 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`. | | diff --git a/docs/SubEditorOptions.md b/docs/SubEditorOptions.md index b1c284b..5483d25 100644 --- a/docs/SubEditorOptions.md +++ b/docs/SubEditorOptions.md @@ -6,8 +6,8 @@ This allows the requester to specify editor options when a preparing a document ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `allowEditSigners` | ```Boolean``` | Allows requesters to edit the list of signers | | | `allowEditDocuments` | ```Boolean``` | Allows requesters to edit documents, including delete and add | | diff --git a/docs/SubFieldOptions.md b/docs/SubFieldOptions.md index 92ef40d..e1be769 100644 --- a/docs/SubFieldOptions.md +++ b/docs/SubFieldOptions.md @@ -6,15 +6,15 @@ This allows the requester to specify field options for a signature request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `dateFormat`*_required_ | [```DateFormatEnum```](#DateFormatEnum) | Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats))

**NOTE:** Only available for Premium and higher. | | ## Enum: DateFormatEnum -Name | Value +| Name | Value | ---- | ----- | MMDDYYYY | "MM / DD / YYYY" | | MM_DD_YYYY | "MM - DD - YYYY" | diff --git a/docs/SubFormFieldGroup.md b/docs/SubFormFieldGroup.md index 676afdd..c55ffa3 100644 --- a/docs/SubFormFieldGroup.md +++ b/docs/SubFormFieldGroup.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `groupId`*_required_ | ```String``` | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | | | `groupLabel`*_required_ | ```String``` | Name of the group | | | `requirement`*_required_ | ```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. | | diff --git a/docs/SubFormFieldRule.md b/docs/SubFormFieldRule.md index eb4d25e..ca44afd 100644 --- a/docs/SubFormFieldRule.md +++ b/docs/SubFormFieldRule.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | Must be unique across all defined rules. | | | `triggerOperator`*_required_ | ```String``` | Currently only `AND` is supported. Support for `OR` is being worked on. | | | `triggers`*_required_ | [```List```](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. | | diff --git a/docs/SubFormFieldRuleAction.md b/docs/SubFormFieldRuleAction.md index 12828ad..6a2d434 100644 --- a/docs/SubFormFieldRuleAction.md +++ b/docs/SubFormFieldRuleAction.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `hidden`*_required_ | ```Boolean``` | `true` to hide the target field when rule is satisfied, otherwise `false`. | | | `type`*_required_ | [```TypeEnum```](#TypeEnum) | | | | `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. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | FIELD_VISIBILITY | "change-field-visibility" | | GROUP_VISIBILITY | "change-group-visibility" | diff --git a/docs/SubFormFieldRuleTrigger.md b/docs/SubFormFieldRuleTrigger.md index ed866d0..3a82561 100644 --- a/docs/SubFormFieldRuleTrigger.md +++ b/docs/SubFormFieldRuleTrigger.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```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`*_required_ | [```OperatorEnum```](#OperatorEnum) | 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` | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: OperatorEnum -Name | Value +| Name | Value | ---- | ----- | ANY | "any" | | IS | "is" | diff --git a/docs/SubFormFieldsPerDocumentBase.md b/docs/SubFormFieldsPerDocumentBase.md index 26ce88d..a44994a 100644 --- a/docs/SubFormFieldsPerDocumentBase.md +++ b/docs/SubFormFieldsPerDocumentBase.md @@ -19,8 +19,8 @@ The fields that should appear on the document, expressed as an array of objects. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `documentIndex`*_required_ | ```Integer``` | Represents the integer index of the `file` or `file_url` document the field should be attached to. | | | `apiId`*_required_ | ```String``` | An identifier for the field that is unique across all documents in the request. | | | `height`*_required_ | ```Integer``` | Size of the field in pixels. | | diff --git a/docs/SubFormFieldsPerDocumentCheckbox.md b/docs/SubFormFieldsPerDocumentCheckbox.md index efcf95d..c4e473f 100644 --- a/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/docs/SubFormFieldsPerDocumentCheckbox.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | | | `isChecked`*_required_ | ```Boolean``` | `true` for checking the checkbox field by default, otherwise `false`. | | | `group` | ```String``` | String referencing group defined in `form_field_groups` parameter. | | diff --git a/docs/SubFormFieldsPerDocumentCheckboxMerge.md b/docs/SubFormFieldsPerDocumentCheckboxMerge.md index efdc811..8243596 100644 --- a/docs/SubFormFieldsPerDocumentCheckboxMerge.md +++ b/docs/SubFormFieldsPerDocumentCheckboxMerge.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | | diff --git a/docs/SubFormFieldsPerDocumentDateSigned.md b/docs/SubFormFieldsPerDocumentDateSigned.md index 49d4b5f..bffc1a4 100644 --- a/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/docs/SubFormFieldsPerDocumentDateSigned.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | | | `fontFamily` | [```FontFamilyEnum```](#FontFamilyEnum) | Font family for the field. | | | `fontSize` | ```Integer``` | 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. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -28,12 +28,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/docs/SubFormFieldsPerDocumentDropdown.md b/docs/SubFormFieldsPerDocumentDropdown.md index afed12e..ca470ea 100644 --- a/docs/SubFormFieldsPerDocumentDropdown.md +++ b/docs/SubFormFieldsPerDocumentDropdown.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | | | `options`*_required_ | ```List``` | Array of string values representing dropdown values. | | | `content` | ```String``` | Selected value in `options` array. Value must exist in array. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -30,12 +30,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/docs/SubFormFieldsPerDocumentFontEnum.md b/docs/SubFormFieldsPerDocumentFontEnum.md index c4ea623..b7582a2 100644 --- a/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/docs/SubFormFieldsPerDocumentFontEnum.md @@ -25,17 +25,17 @@ * `ROBOTO` (value: `"roboto"`) -* `ROBOTOMONO` (value: `"robotoMono"`) +* `ROBOTO_MONO` (value: `"robotoMono"`) -* `NOTOSANS` (value: `"notoSans"`) +* `NOTO_SANS` (value: `"notoSans"`) -* `NOTOSERIF` (value: `"notoSerif"`) +* `NOTO_SERIF` (value: `"notoSerif"`) -* `NOTOCJK_JP_REGULAR` (value: `"notoCJK-JP-Regular"`) +* `NOTO_CJK_JP_REGULAR` (value: `"notoCJK-JP-Regular"`) -* `NOTOHEBREW_REGULAR` (value: `"notoHebrew-Regular"`) +* `NOTO_HEBREW_REGULAR` (value: `"notoHebrew-Regular"`) -* `NOTOSANTHAIMERGED` (value: `"notoSanThaiMerged"`) +* `NOTO_SAN_THAI_MERGED` (value: `"notoSanThaiMerged"`) diff --git a/docs/SubFormFieldsPerDocumentHyperlink.md b/docs/SubFormFieldsPerDocumentHyperlink.md index 220f6f9..543312b 100644 --- a/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/docs/SubFormFieldsPerDocumentHyperlink.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | | | `content`*_required_ | ```String``` | Link Text. | | | `contentUrl`*_required_ | ```String``` | Link URL. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -30,12 +30,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/docs/SubFormFieldsPerDocumentInitials.md b/docs/SubFormFieldsPerDocumentInitials.md index 155c7a5..c3537c2 100644 --- a/docs/SubFormFieldsPerDocumentInitials.md +++ b/docs/SubFormFieldsPerDocumentInitials.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | | diff --git a/docs/SubFormFieldsPerDocumentRadio.md b/docs/SubFormFieldsPerDocumentRadio.md index 38150a4..c194876 100644 --- a/docs/SubFormFieldsPerDocumentRadio.md +++ b/docs/SubFormFieldsPerDocumentRadio.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | | | `group`*_required_ | ```String``` | String referencing group defined in `form_field_groups` parameter. | | | `isChecked`*_required_ | ```Boolean``` | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | | diff --git a/docs/SubFormFieldsPerDocumentSignature.md b/docs/SubFormFieldsPerDocumentSignature.md index 949922a..187b145 100644 --- a/docs/SubFormFieldsPerDocumentSignature.md +++ b/docs/SubFormFieldsPerDocumentSignature.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | | diff --git a/docs/SubFormFieldsPerDocumentText.md b/docs/SubFormFieldsPerDocumentText.md index 9a0c2d6..d431f54 100644 --- a/docs/SubFormFieldsPerDocumentText.md +++ b/docs/SubFormFieldsPerDocumentText.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | | | `placeholder` | ```String``` | Placeholder value for text field. | | | `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. | | @@ -24,7 +24,7 @@ Name | Type | Description | Notes ## Enum: ValidationTypeEnum -Name | Value +| Name | Value | ---- | ----- | NUMBERS_ONLY | "numbers_only" | | LETTERS_ONLY | "letters_only" | @@ -41,7 +41,7 @@ Name | Value ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -53,12 +53,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/docs/SubFormFieldsPerDocumentTextMerge.md b/docs/SubFormFieldsPerDocumentTextMerge.md index a5fc080..e1876cc 100644 --- a/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/docs/SubFormFieldsPerDocumentTextMerge.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | | | `fontFamily` | [```FontFamilyEnum```](#FontFamilyEnum) | Font family for the field. | | | `fontSize` | ```Integer``` | 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. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -28,12 +28,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/docs/SubMergeField.md b/docs/SubMergeField.md index f509e12..6658235 100644 --- a/docs/SubMergeField.md +++ b/docs/SubMergeField.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the merge field. Must be unique. | | | `type`*_required_ | [```TypeEnum```](#TypeEnum) | The type of merge field. | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | TEXT | "text" | | CHECKBOX | "checkbox" | diff --git a/docs/SubOAuth.md b/docs/SubOAuth.md index 23beca8..527d0be 100644 --- a/docs/SubOAuth.md +++ b/docs/SubOAuth.md @@ -6,8 +6,8 @@ OAuth related parameters. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | | | `scopes` | [```List<ScopesEnum>```](#List<ScopesEnum>) | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Enum: List<ScopesEnum> -Name | Value +| Name | Value | ---- | ----- | REQUEST_SIGNATURE | "request_signature" | | BASIC_ACCOUNT_INFO | "basic_account_info" | diff --git a/docs/SubOptions.md b/docs/SubOptions.md index 3ddab2e..c36523a 100644 --- a/docs/SubOptions.md +++ b/docs/SubOptions.md @@ -6,8 +6,8 @@ Additional options supported by API App. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `canInsertEverywhere` | ```Boolean``` | Determines if signers can use "Insert Everywhere" when signing a document. | | diff --git a/docs/SubSignatureRequestGroupedSigners.md b/docs/SubSignatureRequestGroupedSigners.md index d1845fb..80ace34 100644 --- a/docs/SubSignatureRequestGroupedSigners.md +++ b/docs/SubSignatureRequestGroupedSigners.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `group`*_required_ | ```String``` | The name of the group. | | | `signers`*_required_ | [```List```](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` | ```Integer``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | diff --git a/docs/SubSignatureRequestSigner.md b/docs/SubSignatureRequestSigner.md index affc504..109c422 100644 --- a/docs/SubSignatureRequestSigner.md +++ b/docs/SubSignatureRequestSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the signer. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | | `order` | ```Integer``` | The order the signer is required to sign in. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: SmsPhoneNumberTypeEnum -Name | Value +| Name | Value | ---- | ----- | AUTHENTICATION | "authentication" | | DELIVERY | "delivery" | diff --git a/docs/SubSignatureRequestTemplateSigner.md b/docs/SubSignatureRequestTemplateSigner.md index 0db962b..866b373 100644 --- a/docs/SubSignatureRequestTemplateSigner.md +++ b/docs/SubSignatureRequestTemplateSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing role in chosen Template(s). It's case-sensitive. | | | `name`*_required_ | ```String``` | The name of the signer. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: SmsPhoneNumberTypeEnum -Name | Value +| Name | Value | ---- | ----- | AUTHENTICATION | "authentication" | | DELIVERY | "delivery" | diff --git a/docs/SubSigningOptions.md b/docs/SubSigningOptions.md index b4acf7f..bca1160 100644 --- a/docs/SubSigningOptions.md +++ b/docs/SubSigningOptions.md @@ -8,8 +8,8 @@ This allows the requester to specify the types allowed for creating a signature. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `defaultType`*_required_ | [```DefaultTypeEnum```](#DefaultTypeEnum) | The default type shown (limited to the listed types) | | | `draw` | ```Boolean``` | Allows drawing the signature | | | `phone` | ```Boolean``` | Allows using a smartphone to email the signature | | @@ -20,7 +20,7 @@ Name | Type | Description | Notes ## Enum: DefaultTypeEnum -Name | Value +| Name | Value | ---- | ----- | DRAW | "draw" | | PHONE | "phone" | diff --git a/docs/SubTeamResponse.md b/docs/SubTeamResponse.md index 2b67530..df784d0 100644 --- a/docs/SubTeamResponse.md +++ b/docs/SubTeamResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `name` | ```String``` | The name of a team | | diff --git a/docs/SubTemplateRole.md b/docs/SubTemplateRole.md index 88784cd..a1ee8e0 100644 --- a/docs/SubTemplateRole.md +++ b/docs/SubTemplateRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| 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. | | | `order` | ```Integer``` | The order in which this signer role is required to sign. | | diff --git a/docs/SubUnclaimedDraftSigner.md b/docs/SubUnclaimedDraftSigner.md index 70eeb3b..fec680a 100644 --- a/docs/SubUnclaimedDraftSigner.md +++ b/docs/SubUnclaimedDraftSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | | `name`*_required_ | ```String``` | The name of the signer. | | | `order` | ```Integer``` | The order the signer is required to sign in. | | diff --git a/docs/SubUnclaimedDraftTemplateSigner.md b/docs/SubUnclaimedDraftTemplateSigner.md index 5e164c4..1c65476 100644 --- a/docs/SubUnclaimedDraftTemplateSigner.md +++ b/docs/SubUnclaimedDraftTemplateSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing role in chosen Template(s). | | | `name`*_required_ | ```String``` | The name of the signer filling the role of `role`. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer filling the role of `role`. | | diff --git a/docs/SubWhiteLabelingOptions.md b/docs/SubWhiteLabelingOptions.md index c3cb045..0a5880d 100644 --- a/docs/SubWhiteLabelingOptions.md +++ b/docs/SubWhiteLabelingOptions.md @@ -8,8 +8,8 @@ Take a look at our [white labeling guide](https://developers.hellosign.com/api/r ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `headerBackgroundColor` | ```String``` | | | | `legalVersion` | [```LegalVersionEnum```](#LegalVersionEnum) | | | | `linkColor` | ```String``` | | | @@ -30,7 +30,7 @@ Name | Type | Description | Notes ## Enum: LegalVersionEnum -Name | Value +| Name | Value | ---- | ----- | TERMS1 | "terms1" | | TERMS2 | "terms2" | diff --git a/docs/TeamAddMemberRequest.md b/docs/TeamAddMemberRequest.md index 062c8b8..122e45b 100644 --- a/docs/TeamAddMemberRequest.md +++ b/docs/TeamAddMemberRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| 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. | | | `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. | | | `role` | [```RoleEnum```](#RoleEnum) | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: RoleEnum -Name | Value +| Name | Value | ---- | ----- | MEMBER | "Member" | | DEVELOPER | "Developer" | diff --git a/docs/TeamApi.md b/docs/TeamApi.md index 2525598..b35b40e 100644 --- a/docs/TeamApi.md +++ b/docs/TeamApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**teamAddMember**](TeamApi.md#teamAddMember) | **PUT** /team/add_member | Add User to Team [**teamCreate**](TeamApi.md#teamCreate) | **POST** /team/create | Create Team [**teamDelete**](TeamApi.md#teamDelete) | **DELETE** /team/destroy | Delete Team @@ -70,8 +70,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamAddMemberRequest** | [**TeamAddMemberRequest**](TeamAddMemberRequest.md)| | **teamId** | **String**| The id of the team. | [optional] @@ -146,8 +146,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamCreateRequest** | [**TeamCreateRequest**](TeamCreateRequest.md)| | ### Return type @@ -354,8 +354,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the team. | [optional] ### Return type @@ -428,8 +428,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **emailAddress** | **String**| The email address for which to display the team invites. | [optional] ### Return type @@ -504,8 +504,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the team that a member list is being requested from. | **page** | **Integer**| Which page number of the team member list to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -582,8 +582,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamRemoveMemberRequest** | [**TeamRemoveMemberRequest**](TeamRemoveMemberRequest.md)| | ### Return type @@ -658,8 +658,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the parent Team. | **page** | **Integer**| Which page number of the SubTeam List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -735,8 +735,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamUpdateRequest** | [**TeamUpdateRequest**](TeamUpdateRequest.md)| | ### Return type diff --git a/docs/TeamCreateRequest.md b/docs/TeamCreateRequest.md index cb70adc..1a48616 100644 --- a/docs/TeamCreateRequest.md +++ b/docs/TeamCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team. | | diff --git a/docs/TeamGetInfoResponse.md b/docs/TeamGetInfoResponse.md index 3b6d3e3..1d2bc62 100644 --- a/docs/TeamGetInfoResponse.md +++ b/docs/TeamGetInfoResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/TeamGetResponse.md b/docs/TeamGetResponse.md index fe2d79f..690796e 100644 --- a/docs/TeamGetResponse.md +++ b/docs/TeamGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `team` | [```TeamResponse```](TeamResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `team`*_required_ | [```TeamResponse```](TeamResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/TeamInfoResponse.md b/docs/TeamInfoResponse.md index aaf76ca..a776d4e 100644 --- a/docs/TeamInfoResponse.md +++ b/docs/TeamInfoResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `teamParent` | [```TeamParentResponse```](TeamParentResponse.md) | | | | `name` | ```String``` | The name of a team | | diff --git a/docs/TeamInviteResponse.md b/docs/TeamInviteResponse.md index 317bec3..c23aa4e 100644 --- a/docs/TeamInviteResponse.md +++ b/docs/TeamInviteResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress` | ```String``` | Email address of the user invited to this team. | | | `teamId` | ```String``` | Id of the team. | | | `role` | ```String``` | Role of the user invited to this team. | | diff --git a/docs/TeamInvitesResponse.md b/docs/TeamInvitesResponse.md index 5f0e669..bdb648b 100644 --- a/docs/TeamInvitesResponse.md +++ b/docs/TeamInvitesResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `teamInvites` | [```List```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `teamInvites`*_required_ | [```List```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/docs/TeamMemberResponse.md b/docs/TeamMemberResponse.md index e35f8f6..eb42aa0 100644 --- a/docs/TeamMemberResponse.md +++ b/docs/TeamMemberResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | Account id of the team member. | | | `emailAddress` | ```String``` | Email address of the team member. | | | `role` | ```String``` | The specific role a member has on the team. | | diff --git a/docs/TeamMembersResponse.md b/docs/TeamMembersResponse.md index d3e5e67..7853182 100644 --- a/docs/TeamMembersResponse.md +++ b/docs/TeamMembersResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `teamMembers` | [```List```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `teamMembers`*_required_ | [```List```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/docs/TeamParentResponse.md b/docs/TeamParentResponse.md index 1a0d49c..c6ba18a 100644 --- a/docs/TeamParentResponse.md +++ b/docs/TeamParentResponse.md @@ -6,8 +6,8 @@ Information about the parent team if a team has one, set to `null` otherwise. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `name` | ```String``` | The name of a team | | diff --git a/docs/TeamRemoveMemberRequest.md b/docs/TeamRemoveMemberRequest.md index 79d3a4c..46f4853 100644 --- a/docs/TeamRemoveMemberRequest.md +++ b/docs/TeamRemoveMemberRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| 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. | | | `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. | | | `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. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: NewRoleEnum -Name | Value +| Name | Value | ---- | ----- | MEMBER | "Member" | | DEVELOPER | "Developer" | diff --git a/docs/TeamResponse.md b/docs/TeamResponse.md index 2606103..ca6344c 100644 --- a/docs/TeamResponse.md +++ b/docs/TeamResponse.md @@ -6,8 +6,8 @@ Contains information about your team and its members ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team | | | `accounts` | [```List```](AccountResponse.md) | | | | `invitedAccounts` | [```List```](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`. | | diff --git a/docs/TeamSubTeamsResponse.md b/docs/TeamSubTeamsResponse.md index 1b618f8..636aa33 100644 --- a/docs/TeamSubTeamsResponse.md +++ b/docs/TeamSubTeamsResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `subTeams` | [```List```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `subTeams`*_required_ | [```List```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/docs/TeamUpdateRequest.md b/docs/TeamUpdateRequest.md index 545510d..9df0fe1 100644 --- a/docs/TeamUpdateRequest.md +++ b/docs/TeamUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team. | | diff --git a/docs/TemplateAddUserRequest.md b/docs/TemplateAddUserRequest.md index 5415106..7496619 100644 --- a/docs/TemplateAddUserRequest.md +++ b/docs/TemplateAddUserRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| 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. | | | `emailAddress` | ```String``` | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | | | `skipNotification` | ```Boolean``` | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | | diff --git a/docs/TemplateApi.md b/docs/TemplateApi.md index 0a2a448..a3394d6 100644 --- a/docs/TemplateApi.md +++ b/docs/TemplateApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**templateAddUser**](TemplateApi.md#templateAddUser) | **POST** /template/add_user/{template_id} | Add User to Template [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft @@ -71,8 +71,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to give the Account access to. | **templateAddUserRequest** | [**TemplateAddUserRequest**](TemplateAddUserRequest.md)| | @@ -178,8 +178,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateCreateRequest** | [**TemplateCreateRequest**](TemplateCreateRequest.md)| | ### Return type @@ -284,8 +284,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateCreateEmbeddedDraftRequest** | [**TemplateCreateEmbeddedDraftRequest**](TemplateCreateEmbeddedDraftRequest.md)| | ### Return type @@ -356,8 +356,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to delete. | ### Return type @@ -433,8 +433,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | **fileType** | **String**| Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional] [enum: pdf, zip] @@ -510,8 +510,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | ### Return type @@ -586,8 +586,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | **forceDownload** | **Integer**| By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. | [optional] [default to 1] @@ -661,8 +661,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to retrieve. | ### Return type @@ -740,8 +740,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] **page** | **Integer**| Which page number of the Template List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -820,8 +820,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to remove the Account's access to. | **templateRemoveUserRequest** | [**TemplateRemoveUserRequest**](TemplateRemoveUserRequest.md)| | @@ -911,8 +911,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The ID of the template whose files to update. | **templateUpdateFilesRequest** | [**TemplateUpdateFilesRequest**](TemplateUpdateFilesRequest.md)| | diff --git a/docs/TemplateCreateEmbeddedDraftRequest.md b/docs/TemplateCreateEmbeddedDraftRequest.md index be051c8..05f2497 100644 --- a/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/docs/TemplateCreateEmbeddedDraftRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```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``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `fileUrls` | ```List``` | 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. | | diff --git a/docs/TemplateCreateEmbeddedDraftResponse.md b/docs/TemplateCreateEmbeddedDraftResponse.md index 2109e4f..f25b48d 100644 --- a/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/docs/TemplateCreateEmbeddedDraftResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/TemplateCreateEmbeddedDraftResponseTemplate.md b/docs/TemplateCreateEmbeddedDraftResponseTemplate.md index 7b7dc1e..770cce4 100644 --- a/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -6,8 +6,8 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `editUrl` | ```String``` | Link to edit the template. | | | `expiresAt` | ```Integer``` | When the link expires. | | diff --git a/docs/TemplateCreateRequest.md b/docs/TemplateCreateRequest.md index 4d529fd..5f99510 100644 --- a/docs/TemplateCreateRequest.md +++ b/docs/TemplateCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `formFieldsPerDocument`*_required_ | [```List```](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`*_required_ | [```List```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/docs/TemplateCreateResponse.md b/docs/TemplateCreateResponse.md index 6554466..3c73896 100644 --- a/docs/TemplateCreateResponse.md +++ b/docs/TemplateCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/TemplateCreateResponseTemplate.md b/docs/TemplateCreateResponseTemplate.md index ae09826..1dcd4bd 100644 --- a/docs/TemplateCreateResponseTemplate.md +++ b/docs/TemplateCreateResponseTemplate.md @@ -6,8 +6,8 @@ Template object with parameters: `template_id`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | diff --git a/docs/TemplateEditResponse.md b/docs/TemplateEditResponse.md index fe7f907..88d225e 100644 --- a/docs/TemplateEditResponse.md +++ b/docs/TemplateEditResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templateId` | ```String``` | The id of the Template. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateId`*_required_ | ```String``` | The id of the Template. | | diff --git a/docs/TemplateGetResponse.md b/docs/TemplateGetResponse.md index 3e073ba..2ee4867 100644 --- a/docs/TemplateGetResponse.md +++ b/docs/TemplateGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/TemplateListResponse.md b/docs/TemplateListResponse.md index 83e54d7..92b720c 100644 --- a/docs/TemplateListResponse.md +++ b/docs/TemplateListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templates` | [```List```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templates`*_required_ | [```List```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/TemplateRemoveUserRequest.md b/docs/TemplateRemoveUserRequest.md index c269702..72a3a58 100644 --- a/docs/TemplateRemoveUserRequest.md +++ b/docs/TemplateRemoveUserRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| 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. | | | `emailAddress` | ```String``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | diff --git a/docs/TemplateResponse.md b/docs/TemplateResponse.md index 7811ccc..078685f 100644 --- a/docs/TemplateResponse.md +++ b/docs/TemplateResponse.md @@ -6,8 +6,8 @@ Contains information about the templates you and your team have created. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `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. | | | `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. | | diff --git a/docs/TemplateResponseAccount.md b/docs/TemplateResponseAccount.md index bf956bf..10c9964 100644 --- a/docs/TemplateResponseAccount.md +++ b/docs/TemplateResponseAccount.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id of the Account. | | | `emailAddress` | ```String``` | The email address associated with the Account. | | | `isLocked` | ```Boolean``` | Returns `true` if the user has been locked out of their account by a team admin. | | diff --git a/docs/TemplateResponseAccountQuota.md b/docs/TemplateResponseAccountQuota.md index 2ef4344..ad94c24 100644 --- a/docs/TemplateResponseAccountQuota.md +++ b/docs/TemplateResponseAccountQuota.md @@ -6,8 +6,8 @@ An array of the designated CC roles that must be specified when sending a Signat ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templatesLeft` | ```Integer``` | API templates remaining. | | | `apiSignatureRequestsLeft` | ```Integer``` | API signature requests remaining. | | | `documentsLeft` | ```Integer``` | Signature requests remaining. | | diff --git a/docs/TemplateResponseCCRole.md b/docs/TemplateResponseCCRole.md index 1701c97..64069b8 100644 --- a/docs/TemplateResponseCCRole.md +++ b/docs/TemplateResponseCCRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the Role. | | diff --git a/docs/TemplateResponseDocument.md b/docs/TemplateResponseDocument.md index e0a090d..65da85d 100644 --- a/docs/TemplateResponseDocument.md +++ b/docs/TemplateResponseDocument.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | Name of the associated file. | | | `index` | ```Integer``` | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | | | `fieldGroups` | [```List```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | diff --git a/docs/TemplateResponseDocumentCustomFieldBase.md b/docs/TemplateResponseDocumentCustomFieldBase.md index 33ba5cd..edd4617 100644 --- a/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/docs/TemplateResponseDocumentCustomFieldBase.md @@ -6,8 +6,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | The unique ID for this field. | | | `name` | ```String``` | The name of the Custom Field. | | diff --git a/docs/TemplateResponseDocumentCustomFieldCheckbox.md b/docs/TemplateResponseDocumentCustomFieldCheckbox.md index f69fa79..dbde790 100644 --- a/docs/TemplateResponseDocumentCustomFieldCheckbox.md +++ b/docs/TemplateResponseDocumentCustomFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | | diff --git a/docs/TemplateResponseDocumentCustomFieldText.md b/docs/TemplateResponseDocumentCustomFieldText.md index 9fa8d7a..ccaf193 100644 --- a/docs/TemplateResponseDocumentCustomFieldText.md +++ b/docs/TemplateResponseDocumentCustomFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | diff --git a/docs/TemplateResponseDocumentFieldGroup.md b/docs/TemplateResponseDocumentFieldGroup.md index 568bd52..03b5ffb 100644 --- a/docs/TemplateResponseDocumentFieldGroup.md +++ b/docs/TemplateResponseDocumentFieldGroup.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the form field group. | | | `rule` | [```TemplateResponseDocumentFieldGroupRule```](TemplateResponseDocumentFieldGroupRule.md) | | | diff --git a/docs/TemplateResponseDocumentFieldGroupRule.md b/docs/TemplateResponseDocumentFieldGroupRule.md index 48b234a..e0f4dcc 100644 --- a/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/docs/TemplateResponseDocumentFieldGroupRule.md @@ -6,8 +6,8 @@ The rule used to validate checkboxes in the form field group. See [checkbox fiel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| 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. | | | `groupLabel` | ```String``` | Name of the group | | diff --git a/docs/TemplateResponseDocumentFormFieldBase.md b/docs/TemplateResponseDocumentFormFieldBase.md index 00696c3..656070a 100644 --- a/docs/TemplateResponseDocumentFormFieldBase.md +++ b/docs/TemplateResponseDocumentFormFieldBase.md @@ -6,8 +6,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | A unique id for the form field. | | | `name` | ```String``` | The name of the form field. | | diff --git a/docs/TemplateResponseDocumentFormFieldCheckbox.md b/docs/TemplateResponseDocumentFormFieldCheckbox.md index 95a9c47..83d36e0 100644 --- a/docs/TemplateResponseDocumentFormFieldCheckbox.md +++ b/docs/TemplateResponseDocumentFormFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | diff --git a/docs/TemplateResponseDocumentFormFieldDateSigned.md b/docs/TemplateResponseDocumentFormFieldDateSigned.md index 4aeb9b3..5ba66ef 100644 --- a/docs/TemplateResponseDocumentFormFieldDateSigned.md +++ b/docs/TemplateResponseDocumentFormFieldDateSigned.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | diff --git a/docs/TemplateResponseDocumentFormFieldDropdown.md b/docs/TemplateResponseDocumentFormFieldDropdown.md index f4abfa6..b4f2030 100644 --- a/docs/TemplateResponseDocumentFormFieldDropdown.md +++ b/docs/TemplateResponseDocumentFormFieldDropdown.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | diff --git a/docs/TemplateResponseDocumentFormFieldHyperlink.md b/docs/TemplateResponseDocumentFormFieldHyperlink.md index c59fa68..0cf89df 100644 --- a/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | diff --git a/docs/TemplateResponseDocumentFormFieldInitials.md b/docs/TemplateResponseDocumentFormFieldInitials.md index 487fde4..707d67e 100644 --- a/docs/TemplateResponseDocumentFormFieldInitials.md +++ b/docs/TemplateResponseDocumentFormFieldInitials.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | diff --git a/docs/TemplateResponseDocumentFormFieldRadio.md b/docs/TemplateResponseDocumentFormFieldRadio.md index d08e650..b83d96d 100644 --- a/docs/TemplateResponseDocumentFormFieldRadio.md +++ b/docs/TemplateResponseDocumentFormFieldRadio.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | diff --git a/docs/TemplateResponseDocumentFormFieldSignature.md b/docs/TemplateResponseDocumentFormFieldSignature.md index 08173e8..8be2987 100644 --- a/docs/TemplateResponseDocumentFormFieldSignature.md +++ b/docs/TemplateResponseDocumentFormFieldSignature.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | diff --git a/docs/TemplateResponseDocumentFormFieldText.md b/docs/TemplateResponseDocumentFormFieldText.md index a7eec6d..3581d38 100644 --- a/docs/TemplateResponseDocumentFormFieldText.md +++ b/docs/TemplateResponseDocumentFormFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```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` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: ValidationTypeEnum -Name | Value +| Name | Value | ---- | ----- | NUMBERS_ONLY | "numbers_only" | | LETTERS_ONLY | "letters_only" | diff --git a/docs/TemplateResponseDocumentStaticFieldBase.md b/docs/TemplateResponseDocumentStaticFieldBase.md index 18c56b8..4be3cf0 100644 --- a/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/docs/TemplateResponseDocumentStaticFieldBase.md @@ -6,8 +6,8 @@ An array describing static overlay fields. **NOTE:** Only available for certain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | A unique id for the static field. | | | `name` | ```String``` | The name of the static field. | | diff --git a/docs/TemplateResponseDocumentStaticFieldCheckbox.md b/docs/TemplateResponseDocumentStaticFieldCheckbox.md index d33f03d..6cd9485 100644 --- a/docs/TemplateResponseDocumentStaticFieldCheckbox.md +++ b/docs/TemplateResponseDocumentStaticFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldDateSigned.md b/docs/TemplateResponseDocumentStaticFieldDateSigned.md index 5e0eaa6..d5c530d 100644 --- a/docs/TemplateResponseDocumentStaticFieldDateSigned.md +++ b/docs/TemplateResponseDocumentStaticFieldDateSigned.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldDropdown.md b/docs/TemplateResponseDocumentStaticFieldDropdown.md index bb9f131..5350531 100644 --- a/docs/TemplateResponseDocumentStaticFieldDropdown.md +++ b/docs/TemplateResponseDocumentStaticFieldDropdown.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldHyperlink.md b/docs/TemplateResponseDocumentStaticFieldHyperlink.md index a38e229..930658b 100644 --- a/docs/TemplateResponseDocumentStaticFieldHyperlink.md +++ b/docs/TemplateResponseDocumentStaticFieldHyperlink.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldInitials.md b/docs/TemplateResponseDocumentStaticFieldInitials.md index 2026401..67d7557 100644 --- a/docs/TemplateResponseDocumentStaticFieldInitials.md +++ b/docs/TemplateResponseDocumentStaticFieldInitials.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldRadio.md b/docs/TemplateResponseDocumentStaticFieldRadio.md index 7a140fa..ed32ccc 100644 --- a/docs/TemplateResponseDocumentStaticFieldRadio.md +++ b/docs/TemplateResponseDocumentStaticFieldRadio.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldSignature.md b/docs/TemplateResponseDocumentStaticFieldSignature.md index e9a0372..61f8902 100644 --- a/docs/TemplateResponseDocumentStaticFieldSignature.md +++ b/docs/TemplateResponseDocumentStaticFieldSignature.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseDocumentStaticFieldText.md b/docs/TemplateResponseDocumentStaticFieldText.md index 4135e5f..3dced01 100644 --- a/docs/TemplateResponseDocumentStaticFieldText.md +++ b/docs/TemplateResponseDocumentStaticFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | 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` | | diff --git a/docs/TemplateResponseFieldAvgTextLength.md b/docs/TemplateResponseFieldAvgTextLength.md index c1fda15..bb66f30 100644 --- a/docs/TemplateResponseFieldAvgTextLength.md +++ b/docs/TemplateResponseFieldAvgTextLength.md @@ -6,8 +6,8 @@ Average text length in this field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `numLines` | ```Integer``` | Number of lines. | | | `numCharsPerLine` | ```Integer``` | Number of characters per line. | | diff --git a/docs/TemplateResponseSignerRole.md b/docs/TemplateResponseSignerRole.md index b95231d..15b48cf 100644 --- a/docs/TemplateResponseSignerRole.md +++ b/docs/TemplateResponseSignerRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the Role. | | | `order` | ```Integer``` | If signer order is assigned this is the 0-based index for this role. | | diff --git a/docs/TemplateUpdateFilesRequest.md b/docs/TemplateUpdateFilesRequest.md index 2bebedb..8671b87 100644 --- a/docs/TemplateUpdateFilesRequest.md +++ b/docs/TemplateUpdateFilesRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId` | ```String``` | Client id of the app you're using to update this template. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `fileUrls` | ```List``` | 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. | | diff --git a/docs/TemplateUpdateFilesResponse.md b/docs/TemplateUpdateFilesResponse.md index 127b295..70930e1 100644 --- a/docs/TemplateUpdateFilesResponse.md +++ b/docs/TemplateUpdateFilesResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | diff --git a/docs/TemplateUpdateFilesResponseTemplate.md b/docs/TemplateUpdateFilesResponseTemplate.md index 9c198aa..6289a99 100644 --- a/docs/TemplateUpdateFilesResponseTemplate.md +++ b/docs/TemplateUpdateFilesResponseTemplate.md @@ -6,8 +6,8 @@ Contains template id ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/UnclaimedDraftApi.md b/docs/UnclaimedDraftApi.md index fbdf782..4d6d124 100644 --- a/docs/UnclaimedDraftApi.md +++ b/docs/UnclaimedDraftApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**unclaimedDraftCreate**](UnclaimedDraftApi.md#unclaimedDraftCreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft [**unclaimedDraftCreateEmbedded**](UnclaimedDraftApi.md#unclaimedDraftCreateEmbedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft [**unclaimedDraftCreateEmbeddedWithTemplate**](UnclaimedDraftApi.md#unclaimedDraftCreateEmbeddedWithTemplate) | **POST** /unclaimed_draft/create_embedded_with_template | Create Embedded Unclaimed Draft with Template @@ -95,8 +95,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateRequest** | [**UnclaimedDraftCreateRequest**](UnclaimedDraftCreateRequest.md)| | ### Return type @@ -177,8 +177,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateEmbeddedRequest** | [**UnclaimedDraftCreateEmbeddedRequest**](UnclaimedDraftCreateEmbeddedRequest.md)| | ### Return type @@ -270,8 +270,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateEmbeddedWithTemplateRequest** | [**UnclaimedDraftCreateEmbeddedWithTemplateRequest**](UnclaimedDraftCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -350,8 +350,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The ID of the signature request to edit and resend. | **unclaimedDraftEditAndResendRequest** | [**UnclaimedDraftEditAndResendRequest**](UnclaimedDraftEditAndResendRequest.md)| | diff --git a/docs/UnclaimedDraftCreateEmbeddedRequest.md b/docs/UnclaimedDraftCreateEmbeddedRequest.md index 60eebef..aab362d 100644 --- a/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requesterEmailAddress`*_required_ | ```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``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | @@ -49,7 +49,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | SEND_DOCUMENT | "send_document" | | REQUEST_SIGNATURE | "request_signature" | diff --git a/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md b/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md index 52b5175..03ad8b9 100644 --- a/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requesterEmailAddress`*_required_ | ```String``` | The email address of the user that should be designated as the requester of this draft. | | | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | diff --git a/docs/UnclaimedDraftCreateRequest.md b/docs/UnclaimedDraftCreateRequest.md index cd8249a..f23c6f4 100644 --- a/docs/UnclaimedDraftCreateRequest.md +++ b/docs/UnclaimedDraftCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | [```TypeEnum```](#TypeEnum) | 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``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `fileUrls` | ```List``` | 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. | | @@ -37,7 +37,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | SEND_DOCUMENT | "send_document" | | REQUEST_SIGNATURE | "request_signature" | diff --git a/docs/UnclaimedDraftCreateResponse.md b/docs/UnclaimedDraftCreateResponse.md index 65ed7f9..d2d3a7c 100644 --- a/docs/UnclaimedDraftCreateResponse.md +++ b/docs/UnclaimedDraftCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `unclaimedDraft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `unclaimedDraft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/docs/UnclaimedDraftEditAndResendRequest.md b/docs/UnclaimedDraftEditAndResendRequest.md index daefa5a..8eb306a 100644 --- a/docs/UnclaimedDraftEditAndResendRequest.md +++ b/docs/UnclaimedDraftEditAndResendRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```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) | | | | `isForEmbeddedSigning` | ```Boolean``` | The request created from this draft will also be signable in embedded mode if set to `true`. | | diff --git a/docs/UnclaimedDraftResponse.md b/docs/UnclaimedDraftResponse.md index ab1858d..ab470a2 100644 --- a/docs/UnclaimedDraftResponse.md +++ b/docs/UnclaimedDraftResponse.md @@ -6,8 +6,8 @@ A group of documents that a user can take ownership of via the claim URL. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureRequestId` | ```String``` | The ID of the signature request that is represented by this UnclaimedDraft. | | | `claimUrl` | ```String``` | The URL to be used to claim this UnclaimedDraft. | | | `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | diff --git a/docs/WarningResponse.md b/docs/WarningResponse.md index b041bb3..50cad9b 100644 --- a/docs/WarningResponse.md +++ b/docs/WarningResponse.md @@ -6,8 +6,8 @@ A list of warnings. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `warningMsg`*_required_ | ```String``` | Warning message | | | `warningName`*_required_ | ```String``` | Warning name | | diff --git a/examples/FaxLineAddUser.java b/examples/FaxLineAddUser.java new file mode 100644 index 0000000..34e455d --- /dev/null +++ b/examples/FaxLineAddUser.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineAddUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineAddUser(data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxLineAreaCodeGet.java b/examples/FaxLineAreaCodeGet.java new file mode 100644 index 0000000..1df071a --- /dev/null +++ b/examples/FaxLineAreaCodeGet.java @@ -0,0 +1,26 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineAreaCodeGetResponse result = faxLineApi.faxLineAreaCodeGet("US", "CA"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxLineCreate.java b/examples/FaxLineCreate.java new file mode 100644 index 0000000..fca1018 --- /dev/null +++ b/examples/FaxLineCreate.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxLineResponse result = faxLineApi.faxLineCreate(data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxLineDelete.java b/examples/FaxLineDelete.java new file mode 100644 index 0000000..6b989d2 --- /dev/null +++ b/examples/FaxLineDelete.java @@ -0,0 +1,28 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineDeleteRequest() + .number("[FAX_NUMBER]"); + + try { + faxLineApi.faxLineDelete(data); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxLineGet.java b/examples/FaxLineGet.java new file mode 100644 index 0000000..69281b3 --- /dev/null +++ b/examples/FaxLineGet.java @@ -0,0 +1,26 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineResponse result = faxLineApi.faxLineGet("[FAX_NUMBER]"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxLineList.java b/examples/FaxLineList.java new file mode 100644 index 0000000..df1d0bd --- /dev/null +++ b/examples/FaxLineList.java @@ -0,0 +1,26 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineListResponse result = faxLineApi.faxLineList(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxLineRemoveUser.java b/examples/FaxLineRemoveUser.java new file mode 100644 index 0000000..7864b05 --- /dev/null +++ b/examples/FaxLineRemoveUser.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineRemoveUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineRemoveUser(data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/gradle.properties b/gradle.properties index 5fdb250..cbaa31a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ #target = android GROUP=com.dropbox.sign POM_ARTIFACT_ID=dropbox-sign -VERSION_NAME=2.1.0 +VERSION_NAME=2.2.0 POM_NAME=Dropbox Sign Java SDK POM_DESCRIPTION=Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..e6441136f3d4ba8a0da8d277868979cfbc8ad796 100644 GIT binary patch literal 43453 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F0sur@TMa!Y}S8irn(%d-gi0*WxxCSk*A?3lGh=gcYN?FGl z7D=Js!i~0=u3rox^eO3i@$0=n{K1lPNU zwmfjRVmLOCRfe=seV&P*1Iq=^i`502keY8Uy-WNPwVNNtJFx?IwAyRPZo2Wo1+S(xF37LJZ~%i)kpFQ3Fw=mXfd@>%+)RpYQLnr}B~~zoof(JVm^^&f zxKV^+3D3$A1G;qh4gPVjhrC8e(VYUHv#dy^)(RoUFM?o%W-EHxufuWf(l*@-l+7vt z=l`qmR56K~F|v<^Pd*p~1_y^P0P^aPC##d8+HqX4IR1gu+7w#~TBFphJxF)T$2WEa zxa?H&6=Qe7d(#tha?_1uQys2KtHQ{)Qco)qwGjrdNL7thd^G5i8Os)CHqc>iOidS} z%nFEDdm=GXBw=yXe1W-ShHHFb?Cc70+$W~z_+}nAoHFYI1MV1wZegw*0y^tC*s%3h zhD3tN8b=Gv&rj}!SUM6|ajSPp*58KR7MPpI{oAJCtY~JECm)*m_x>AZEu>DFgUcby z1Qaw8lU4jZpQ_$;*7RME+gq1KySGG#Wql>aL~k9tLrSO()LWn*q&YxHEuzmwd1?aAtI zBJ>P=&$=l1efe1CDU;`Fd+_;&wI07?V0aAIgc(!{a z0Jg6Y=inXc3^n!U0Atk`iCFIQooHqcWhO(qrieUOW8X(x?(RD}iYDLMjSwffH2~tB z)oDgNBLB^AJBM1M^c5HdRx6fBfka`(LD-qrlh5jqH~);#nw|iyp)()xVYak3;Ybik z0j`(+69aK*B>)e_p%=wu8XC&9e{AO4c~O1U`5X9}?0mrd*m$_EUek{R?DNSh(=br# z#Q61gBzEpmy`$pA*6!87 zSDD+=@fTY7<4A?GLqpA?Pb2z$pbCc4B4zL{BeZ?F-8`s$?>*lXXtn*NC61>|*w7J* z$?!iB{6R-0=KFmyp1nnEmLsA-H0a6l+1uaH^g%c(p{iT&YFrbQ$&PRb8Up#X3@Zsk zD^^&LK~111%cqlP%!_gFNa^dTYT?rhkGl}5=fL{a`UViaXWI$k-UcHJwmaH1s=S$4 z%4)PdWJX;hh5UoK?6aWoyLxX&NhNRqKam7tcOkLh{%j3K^4Mgx1@i|Pi&}<^5>hs5 zm8?uOS>%)NzT(%PjVPGa?X%`N2TQCKbeH2l;cTnHiHppPSJ<7y-yEIiC!P*ikl&!B z%+?>VttCOQM@ShFguHVjxX^?mHX^hSaO_;pnyh^v9EumqSZTi+#f&_Vaija0Q-e*| z7ulQj6Fs*bbmsWp{`auM04gGwsYYdNNZcg|ph0OgD>7O}Asn7^Z=eI>`$2*v78;sj-}oMoEj&@)9+ycEOo92xSyY344^ z11Hb8^kdOvbf^GNAK++bYioknrpdN>+u8R?JxG=!2Kd9r=YWCOJYXYuM0cOq^FhEd zBg2puKy__7VT3-r*dG4c62Wgxi52EMCQ`bKgf*#*ou(D4-ZN$+mg&7$u!! z-^+Z%;-3IDwqZ|K=ah85OLwkO zKxNBh+4QHh)u9D?MFtpbl)us}9+V!D%w9jfAMYEb>%$A;u)rrI zuBudh;5PN}_6J_}l55P3l_)&RMlH{m!)ai-i$g)&*M`eN$XQMw{v^r@-125^RRCF0 z^2>|DxhQw(mtNEI2Kj(;KblC7x=JlK$@78`O~>V!`|1Lm-^JR$-5pUANAnb(5}B}JGjBsliK4& zk6y(;$e&h)lh2)L=bvZKbvh@>vLlreBdH8No2>$#%_Wp1U0N7Ank!6$dFSi#xzh|( zRi{Uw%-4W!{IXZ)fWx@XX6;&(m_F%c6~X8hx=BN1&q}*( zoaNjWabE{oUPb!Bt$eyd#$5j9rItB-h*5JiNi(v^e|XKAj*8(k<5-2$&ZBR5fF|JA z9&m4fbzNQnAU}r8ab>fFV%J0z5awe#UZ|bz?Ur)U9bCIKWEzi2%A+5CLqh?}K4JHi z4vtM;+uPsVz{Lfr;78W78gC;z*yTch~4YkLr&m-7%-xc ztw6Mh2d>_iO*$Rd8(-Cr1_V8EO1f*^@wRoSozS) zy1UoC@pruAaC8Z_7~_w4Q6n*&B0AjOmMWa;sIav&gu z|J5&|{=a@vR!~k-OjKEgPFCzcJ>#A1uL&7xTDn;{XBdeM}V=l3B8fE1--DHjSaxoSjNKEM9|U9#m2<3>n{Iuo`r3UZp;>GkT2YBNAh|b z^jTq-hJp(ebZh#Lk8hVBP%qXwv-@vbvoREX$TqRGTgEi$%_F9tZES@z8Bx}$#5eeG zk^UsLBH{bc2VBW)*EdS({yw=?qmevwi?BL6*=12k9zM5gJv1>y#ML4!)iiPzVaH9% zgSImetD@dam~e>{LvVh!phhzpW+iFvWpGT#CVE5TQ40n%F|p(sP5mXxna+Ev7PDwA zamaV4m*^~*xV+&p;W749xhb_X=$|LD;FHuB&JL5?*Y2-oIT(wYY2;73<^#46S~Gx| z^cez%V7x$81}UWqS13Gz80379Rj;6~WdiXWOSsdmzY39L;Hg3MH43o*y8ibNBBH`(av4|u;YPq%{R;IuYow<+GEsf@R?=@tT@!}?#>zIIn0CoyV!hq3mw zHj>OOjfJM3F{RG#6ujzo?y32m^tgSXf@v=J$ELdJ+=5j|=F-~hP$G&}tDZsZE?5rX ztGj`!S>)CFmdkccxM9eGIcGnS2AfK#gXwj%esuIBNJQP1WV~b~+D7PJTmWGTSDrR` zEAu4B8l>NPuhsk5a`rReSya2nfV1EK01+G!x8aBdTs3Io$u5!6n6KX%uv@DxAp3F@{4UYg4SWJtQ-W~0MDb|j-$lwVn znAm*Pl!?Ps&3wO=R115RWKb*JKoexo*)uhhHBncEDMSVa_PyA>k{Zm2(wMQ(5NM3# z)jkza|GoWEQo4^s*wE(gHz?Xsg4`}HUAcs42cM1-qq_=+=!Gk^y710j=66(cSWqUe zklbm8+zB_syQv5A2rj!Vbw8;|$@C!vfNmNV!yJIWDQ>{+2x zKjuFX`~~HKG~^6h5FntRpnnHt=D&rq0>IJ9#F0eM)Y-)GpRjiN7gkA8wvnG#K=q{q z9dBn8_~wm4J<3J_vl|9H{7q6u2A!cW{bp#r*-f{gOV^e=8S{nc1DxMHFwuM$;aVI^ zz6A*}m8N-&x8;aunp1w7_vtB*pa+OYBw=TMc6QK=mbA-|Cf* zvyh8D4LRJImooUaSb7t*fVfih<97Gf@VE0|z>NcBwBQze);Rh!k3K_sfunToZY;f2 z^HmC4KjHRVg+eKYj;PRN^|E0>Gj_zagfRbrki68I^#~6-HaHg3BUW%+clM1xQEdPYt_g<2K+z!$>*$9nQ>; zf9Bei{?zY^-e{q_*|W#2rJG`2fy@{%6u0i_VEWTq$*(ZN37|8lFFFt)nCG({r!q#9 z5VK_kkSJ3?zOH)OezMT{!YkCuSSn!K#-Rhl$uUM(bq*jY? zi1xbMVthJ`E>d>(f3)~fozjg^@eheMF6<)I`oeJYx4*+M&%c9VArn(OM-wp%M<-`x z7sLP1&3^%Nld9Dhm@$3f2}87!quhI@nwd@3~fZl_3LYW-B?Ia>ui`ELg z&Qfe!7m6ze=mZ`Ia9$z|ARSw|IdMpooY4YiPN8K z4B(ts3p%2i(Td=tgEHX z0UQ_>URBtG+-?0E;E7Ld^dyZ;jjw0}XZ(}-QzC6+NN=40oDb2^v!L1g9xRvE#@IBR zO!b-2N7wVfLV;mhEaXQ9XAU+>=XVA6f&T4Z-@AX!leJ8obP^P^wP0aICND?~w&NykJ#54x3_@r7IDMdRNy4Hh;h*!u(Ol(#0bJdwEo$5437-UBjQ+j=Ic>Q2z` zJNDf0yO6@mr6y1#n3)s(W|$iE_i8r@Gd@!DWDqZ7J&~gAm1#~maIGJ1sls^gxL9LLG_NhU!pTGty!TbhzQnu)I*S^54U6Yu%ZeCg`R>Q zhBv$n5j0v%O_j{QYWG!R9W?5_b&67KB$t}&e2LdMvd(PxN6Ir!H4>PNlerpBL>Zvyy!yw z-SOo8caEpDt(}|gKPBd$qND5#a5nju^O>V&;f890?yEOfkSG^HQVmEbM3Ugzu+UtH zC(INPDdraBN?P%kE;*Ae%Wto&sgw(crfZ#Qy(<4nk;S|hD3j{IQRI6Yq|f^basLY; z-HB&Je%Gg}Jt@={_C{L$!RM;$$|iD6vu#3w?v?*;&()uB|I-XqEKqZPS!reW9JkLewLb!70T7n`i!gNtb1%vN- zySZj{8-1>6E%H&=V}LM#xmt`J3XQoaD|@XygXjdZ1+P77-=;=eYpoEQ01B@L*a(uW zrZeZz?HJsw_4g0vhUgkg@VF8<-X$B8pOqCuWAl28uB|@r`19DTUQQsb^pfqB6QtiT z*`_UZ`fT}vtUY#%sq2{rchyfu*pCg;uec2$-$N_xgjZcoumE5vSI{+s@iLWoz^Mf; zuI8kDP{!XY6OP~q5}%1&L}CtfH^N<3o4L@J@zg1-mt{9L`s^z$Vgb|mr{@WiwAqKg zp#t-lhrU>F8o0s1q_9y`gQNf~Vb!F%70f}$>i7o4ho$`uciNf=xgJ>&!gSt0g;M>*x4-`U)ysFW&Vs^Vk6m%?iuWU+o&m(2Jm26Y(3%TL; zA7T)BP{WS!&xmxNw%J=$MPfn(9*^*TV;$JwRy8Zl*yUZi8jWYF>==j~&S|Xinsb%c z2?B+kpet*muEW7@AzjBA^wAJBY8i|#C{WtO_or&Nj2{=6JTTX05}|H>N2B|Wf!*3_ z7hW*j6p3TvpghEc6-wufFiY!%-GvOx*bZrhZu+7?iSrZL5q9}igiF^*R3%DE4aCHZ zqu>xS8LkW+Auv%z-<1Xs92u23R$nk@Pk}MU5!gT|c7vGlEA%G^2th&Q*zfg%-D^=f z&J_}jskj|Q;73NP4<4k*Y%pXPU2Thoqr+5uH1yEYM|VtBPW6lXaetokD0u z9qVek6Q&wk)tFbQ8(^HGf3Wp16gKmr>G;#G(HRBx?F`9AIRboK+;OfHaLJ(P>IP0w zyTbTkx_THEOs%Q&aPrxbZrJlio+hCC_HK<4%f3ZoSAyG7Dn`=X=&h@m*|UYO-4Hq0 z-Bq&+Ie!S##4A6OGoC~>ZW`Y5J)*ouaFl_e9GA*VSL!O_@xGiBw!AF}1{tB)z(w%c zS1Hmrb9OC8>0a_$BzeiN?rkPLc9%&;1CZW*4}CDDNr2gcl_3z+WC15&H1Zc2{o~i) z)LLW=WQ{?ricmC`G1GfJ0Yp4Dy~Ba;j6ZV4r{8xRs`13{dD!xXmr^Aga|C=iSmor% z8hi|pTXH)5Yf&v~exp3o+sY4B^^b*eYkkCYl*T{*=-0HniSA_1F53eCb{x~1k3*`W zr~};p1A`k{1DV9=UPnLDgz{aJH=-LQo<5%+Em!DNN252xwIf*wF_zS^!(XSm(9eoj z=*dXG&n0>)_)N5oc6v!>-bd(2ragD8O=M|wGW z!xJQS<)u70m&6OmrF0WSsr@I%T*c#Qo#Ha4d3COcX+9}hM5!7JIGF>7<~C(Ear^Sn zm^ZFkV6~Ula6+8S?oOROOA6$C&q&dp`>oR-2Ym3(HT@O7Sd5c~+kjrmM)YmgPH*tL zX+znN>`tv;5eOfX?h{AuX^LK~V#gPCu=)Tigtq9&?7Xh$qN|%A$?V*v=&-2F$zTUv z`C#WyIrChS5|Kgm_GeudCFf;)!WH7FI60j^0o#65o6`w*S7R@)88n$1nrgU(oU0M9 zx+EuMkC>(4j1;m6NoGqEkpJYJ?vc|B zOlwT3t&UgL!pX_P*6g36`ZXQ; z9~Cv}ANFnJGp(;ZhS(@FT;3e)0)Kp;h^x;$*xZn*k0U6-&FwI=uOGaODdrsp-!K$Ac32^c{+FhI-HkYd5v=`PGsg%6I`4d9Jy)uW0y%) zm&j^9WBAp*P8#kGJUhB!L?a%h$hJgQrx!6KCB_TRo%9{t0J7KW8!o1B!NC)VGLM5! zpZy5Jc{`r{1e(jd%jsG7k%I+m#CGS*BPA65ZVW~fLYw0dA-H_}O zrkGFL&P1PG9p2(%QiEWm6x;U-U&I#;Em$nx-_I^wtgw3xUPVVu zqSuKnx&dIT-XT+T10p;yjo1Y)z(x1fb8Dzfn8e yu?e%!_ptzGB|8GrCfu%p?(_ zQccdaaVK$5bz;*rnyK{_SQYM>;aES6Qs^lj9lEs6_J+%nIiuQC*fN;z8md>r_~Mfl zU%p5Dt_YT>gQqfr@`cR!$NWr~+`CZb%dn;WtzrAOI>P_JtsB76PYe*<%H(y>qx-`Kq!X_; z<{RpAqYhE=L1r*M)gNF3B8r(<%8mo*SR2hu zccLRZwGARt)Hlo1euqTyM>^!HK*!Q2P;4UYrysje@;(<|$&%vQekbn|0Ruu_Io(w4#%p6ld2Yp7tlA`Y$cciThP zKzNGIMPXX%&Ud0uQh!uQZz|FB`4KGD?3!ND?wQt6!n*f4EmCoJUh&b?;B{|lxs#F- z31~HQ`SF4x$&v00@(P+j1pAaj5!s`)b2RDBp*PB=2IB>oBF!*6vwr7Dp%zpAx*dPr zb@Zjq^XjN?O4QcZ*O+8>)|HlrR>oD*?WQl5ri3R#2?*W6iJ>>kH%KnnME&TT@ZzrHS$Q%LC?n|e>V+D+8D zYc4)QddFz7I8#}y#Wj6>4P%34dZH~OUDb?uP%-E zwjXM(?Sg~1!|wI(RVuxbu)-rH+O=igSho_pDCw(c6b=P zKk4ATlB?bj9+HHlh<_!&z0rx13K3ZrAR8W)!@Y}o`?a*JJsD+twZIv`W)@Y?Amu_u zz``@-e2X}27$i(2=9rvIu5uTUOVhzwu%mNazS|lZb&PT;XE2|B&W1>=B58#*!~D&) zfVmJGg8UdP*fx(>Cj^?yS^zH#o-$Q-*$SnK(ZVFkw+er=>N^7!)FtP3y~Xxnu^nzY zikgB>Nj0%;WOltWIob|}%lo?_C7<``a5hEkx&1ku$|)i>Rh6@3h*`slY=9U}(Ql_< zaNG*J8vb&@zpdhAvv`?{=zDedJ23TD&Zg__snRAH4eh~^oawdYi6A3w8<Ozh@Kw)#bdktM^GVb zrG08?0bG?|NG+w^&JvD*7LAbjED{_Zkc`3H!My>0u5Q}m!+6VokMLXxl`Mkd=g&Xx z-a>m*#G3SLlhbKB!)tnzfWOBV;u;ftU}S!NdD5+YtOjLg?X}dl>7m^gOpihrf1;PY zvll&>dIuUGs{Qnd- zwIR3oIrct8Va^Tm0t#(bJD7c$Z7DO9*7NnRZorrSm`b`cxz>OIC;jSE3DO8`hX955ui`s%||YQtt2 z5DNA&pG-V+4oI2s*x^>-$6J?p=I>C|9wZF8z;VjR??Icg?1w2v5Me+FgAeGGa8(3S z4vg*$>zC-WIVZtJ7}o9{D-7d>zCe|z#<9>CFve-OPAYsneTb^JH!Enaza#j}^mXy1 z+ULn^10+rWLF6j2>Ya@@Kq?26>AqK{A_| zQKb*~F1>sE*=d?A?W7N2j?L09_7n+HGi{VY;MoTGr_)G9)ot$p!-UY5zZ2Xtbm=t z@dpPSGwgH=QtIcEulQNI>S-#ifbnO5EWkI;$A|pxJd885oM+ zGZ0_0gDvG8q2xebj+fbCHYfAXuZStH2j~|d^sBAzo46(K8n59+T6rzBwK)^rfPT+B zyIFw)9YC-V^rhtK`!3jrhmW-sTmM+tPH+;nwjL#-SjQPUZ53L@A>y*rt(#M(qsiB2 zx6B)dI}6Wlsw%bJ8h|(lhkJVogQZA&n{?Vgs6gNSXzuZpEyu*xySy8ro07QZ7Vk1!3tJphN_5V7qOiyK8p z#@jcDD8nmtYi1^l8ml;AF<#IPK?!pqf9D4moYk>d99Im}Jtwj6c#+A;f)CQ*f-hZ< z=p_T86jog%!p)D&5g9taSwYi&eP z#JuEK%+NULWus;0w32-SYFku#i}d~+{Pkho&^{;RxzP&0!RCm3-9K6`>KZpnzS6?L z^H^V*s!8<>x8bomvD%rh>Zp3>Db%kyin;qtl+jAv8Oo~1g~mqGAC&Qi_wy|xEt2iz zWAJEfTV%cl2Cs<1L&DLRVVH05EDq`pH7Oh7sR`NNkL%wi}8n>IXcO40hp+J+sC!W?!krJf!GJNE8uj zg-y~Ns-<~D?yqbzVRB}G>0A^f0!^N7l=$m0OdZuqAOQqLc zX?AEGr1Ht+inZ-Qiwnl@Z0qukd__a!C*CKuGdy5#nD7VUBM^6OCpxCa2A(X;e0&V4 zM&WR8+wErQ7UIc6LY~Q9x%Sn*Tn>>P`^t&idaOEnOd(Ufw#>NoR^1QdhJ8s`h^|R_ zXX`c5*O~Xdvh%q;7L!_!ohf$NfEBmCde|#uVZvEo>OfEq%+Ns7&_f$OR9xsihRpBb z+cjk8LyDm@U{YN>+r46?nn{7Gh(;WhFw6GAxtcKD+YWV?uge>;+q#Xx4!GpRkVZYu zzsF}1)7$?%s9g9CH=Zs+B%M_)+~*j3L0&Q9u7!|+T`^O{xE6qvAP?XWv9_MrZKdo& z%IyU)$Q95AB4!#hT!_dA>4e@zjOBD*Y=XjtMm)V|+IXzjuM;(l+8aA5#Kaz_$rR6! zj>#&^DidYD$nUY(D$mH`9eb|dtV0b{S>H6FBfq>t5`;OxA4Nn{J(+XihF(stSche7$es&~N$epi&PDM_N`As;*9D^L==2Q7Z2zD+CiU(|+-kL*VG+&9!Yb3LgPy?A zm7Z&^qRG_JIxK7-FBzZI3Q<;{`DIxtc48k> zc|0dmX;Z=W$+)qE)~`yn6MdoJ4co;%!`ddy+FV538Y)j(vg}5*k(WK)KWZ3WaOG!8 z!syGn=s{H$odtpqFrT#JGM*utN7B((abXnpDM6w56nhw}OY}0TiTG1#f*VFZr+^-g zbP10`$LPq_;PvrA1XXlyx2uM^mrjTzX}w{yuLo-cOClE8MMk47T25G8M!9Z5ypOSV zAJUBGEg5L2fY)ZGJb^E34R2zJ?}Vf>{~gB!8=5Z) z9y$>5c)=;o0HeHHSuE4U)#vG&KF|I%-cF6f$~pdYJWk_dD}iOA>iA$O$+4%@>JU08 zS`ep)$XLPJ+n0_i@PkF#ri6T8?ZeAot$6JIYHm&P6EB=BiaNY|aA$W0I+nz*zkz_z zkEru!tj!QUffq%)8y0y`T&`fuus-1p>=^hnBiBqD^hXrPs`PY9tU3m0np~rISY09> z`P3s=-kt_cYcxWd{de@}TwSqg*xVhp;E9zCsnXo6z z?f&Sv^U7n4`xr=mXle94HzOdN!2kB~4=%)u&N!+2;z6UYKUDqi-s6AZ!haB;@&B`? z_TRX0%@suz^TRdCb?!vNJYPY8L_}&07uySH9%W^Tc&1pia6y1q#?*Drf}GjGbPjBS zbOPcUY#*$3sL2x4v_i*Y=N7E$mR}J%|GUI(>WEr+28+V z%v5{#e!UF*6~G&%;l*q*$V?&r$Pp^sE^i-0$+RH3ERUUdQ0>rAq2(2QAbG}$y{de( z>{qD~GGuOk559Y@%$?N^1ApVL_a704>8OD%8Y%8B;FCt%AoPu8*D1 zLB5X>b}Syz81pn;xnB}%0FnwazlWfUV)Z-~rZg6~b z6!9J$EcE&sEbzcy?CI~=boWA&eeIa%z(7SE^qgVLz??1Vbc1*aRvc%Mri)AJaAG!p z$X!_9Ds;Zz)f+;%s&dRcJt2==P{^j3bf0M=nJd&xwUGlUFn?H=2W(*2I2Gdu zv!gYCwM10aeus)`RIZSrCK=&oKaO_Ry~D1B5!y0R=%!i2*KfXGYX&gNv_u+n9wiR5 z*e$Zjju&ODRW3phN925%S(jL+bCHv6rZtc?!*`1TyYXT6%Ju=|X;6D@lq$8T zW{Y|e39ioPez(pBH%k)HzFITXHvnD6hw^lIoUMA;qAJ^CU?top1fo@s7xT13Fvn1H z6JWa-6+FJF#x>~+A;D~;VDs26>^oH0EI`IYT2iagy23?nyJ==i{g4%HrAf1-*v zK1)~@&(KkwR7TL}L(A@C_S0G;-GMDy=MJn2$FP5s<%wC)4jC5PXoxrQBFZ_k0P{{s@sz+gX`-!=T8rcB(=7vW}^K6oLWMmp(rwDh}b zwaGGd>yEy6fHv%jM$yJXo5oMAQ>c9j`**}F?MCry;T@47@r?&sKHgVe$MCqk#Z_3S z1GZI~nOEN*P~+UaFGnj{{Jo@16`(qVNtbU>O0Hf57-P>x8Jikp=`s8xWs^dAJ9lCQ z)GFm+=OV%AMVqVATtN@|vp61VVAHRn87}%PC^RAzJ%JngmZTasWBAWsoAqBU+8L8u z4A&Pe?fmTm0?mK-BL9t+{y7o(7jm+RpOhL9KnY#E&qu^}B6=K_dB}*VlSEiC9fn)+V=J;OnN)Ta5v66ic1rG+dGAJ1 z1%Zb_+!$=tQ~lxQrzv3x#CPb?CekEkA}0MYSgx$Jdd}q8+R=ma$|&1a#)TQ=l$1tQ z=tL9&_^vJ)Pk}EDO-va`UCT1m#Uty1{v^A3P~83_#v^ozH}6*9mIjIr;t3Uv%@VeW zGL6(CwCUp)Jq%G0bIG%?{_*Y#5IHf*5M@wPo6A{$Um++Co$wLC=J1aoG93&T7Ho}P z=mGEPP7GbvoG!uD$k(H3A$Z))+i{Hy?QHdk>3xSBXR0j!11O^mEe9RHmw!pvzv?Ua~2_l2Yh~_!s1qS`|0~0)YsbHSz8!mG)WiJE| z2f($6TQtt6L_f~ApQYQKSb=`053LgrQq7G@98#igV>y#i==-nEjQ!XNu9 z~;mE+gtj4IDDNQJ~JVk5Ux6&LCSFL!y=>79kE9=V}J7tD==Ga+IW zX)r7>VZ9dY=V&}DR))xUoV!u(Z|%3ciQi_2jl}3=$Agc(`RPb z8kEBpvY>1FGQ9W$n>Cq=DIpski};nE)`p3IUw1Oz0|wxll^)4dq3;CCY@RyJgFgc# zKouFh!`?Xuo{IMz^xi-h=StCis_M7yq$u) z?XHvw*HP0VgR+KR6wI)jEMX|ssqYvSf*_3W8zVTQzD?3>H!#>InzpSO)@SC8q*ii- z%%h}_#0{4JG;Jm`4zg};BPTGkYamx$Xo#O~lBirRY)q=5M45n{GCfV7h9qwyu1NxOMoP4)jjZMxmT|IQQh0U7C$EbnMN<3)Kk?fFHYq$d|ICu>KbY_hO zTZM+uKHe(cIZfEqyzyYSUBZa8;Fcut-GN!HSA9ius`ltNebF46ZX_BbZNU}}ZOm{M2&nANL9@0qvih15(|`S~z}m&h!u4x~(%MAO$jHRWNfuxWF#B)E&g3ghSQ9|> z(MFaLQj)NE0lowyjvg8z0#m6FIuKE9lDO~Glg}nSb7`~^&#(Lw{}GVOS>U)m8bF}x zVjbXljBm34Cs-yM6TVusr+3kYFjr28STT3g056y3cH5Tmge~ASxBj z%|yb>$eF;WgrcOZf569sDZOVwoo%8>XO>XQOX1OyN9I-SQgrm;U;+#3OI(zrWyow3 zk==|{lt2xrQ%FIXOTejR>;wv(Pb8u8}BUpx?yd(Abh6? zsoO3VYWkeLnF43&@*#MQ9-i-d0t*xN-UEyNKeyNMHw|A(k(_6QKO=nKMCxD(W(Yop zsRQ)QeL4X3Lxp^L%wzi2-WVSsf61dqliPUM7srDB?Wm6Lzn0&{*}|IsKQW;02(Y&| zaTKv|`U(pSzuvR6Rduu$wzK_W-Y-7>7s?G$)U}&uK;<>vU}^^ns@Z!p+9?St1s)dG zK%y6xkPyyS1$~&6v{kl?Md6gwM|>mt6Upm>oa8RLD^8T{0?HC!Z>;(Bob7el(DV6x zi`I)$&E&ngwFS@bi4^xFLAn`=fzTC;aimE^!cMI2n@Vo%Ae-ne`RF((&5y6xsjjAZ zVguVoQ?Z9uk$2ON;ersE%PU*xGO@T*;j1BO5#TuZKEf(mB7|g7pcEA=nYJ{s3vlbg zd4-DUlD{*6o%Gc^N!Nptgay>j6E5;3psI+C3Q!1ZIbeCubW%w4pq9)MSDyB{HLm|k zxv-{$$A*pS@csolri$Ge<4VZ}e~78JOL-EVyrbxKra^d{?|NnPp86!q>t<&IP07?Z z^>~IK^k#OEKgRH+LjllZXk7iA>2cfH6+(e&9ku5poo~6y{GC5>(bRK7hwjiurqAiZ zg*DmtgY}v83IjE&AbiWgMyFbaRUPZ{lYiz$U^&Zt2YjG<%m((&_JUbZcfJ22(>bi5 z!J?<7AySj0JZ&<-qXX;mcV!f~>G=sB0KnjWca4}vrtunD^1TrpfeS^4dvFr!65knK zZh`d;*VOkPs4*-9kL>$GP0`(M!j~B;#x?Ba~&s6CopvO86oM?-? zOw#dIRc;6A6T?B`Qp%^<U5 z19x(ywSH$_N+Io!6;e?`tWaM$`=Db!gzx|lQ${DG!zb1Zl&|{kX0y6xvO1o z220r<-oaS^^R2pEyY;=Qllqpmue|5yI~D|iI!IGt@iod{Opz@*ml^w2bNs)p`M(Io z|E;;m*Xpjd9l)4G#KaWfV(t8YUn@A;nK^#xgv=LtnArX|vWQVuw3}B${h+frU2>9^ z!l6)!Uo4`5k`<<;E(ido7M6lKTgWezNLq>U*=uz&s=cc$1%>VrAeOoUtA|T6gO4>UNqsdK=NF*8|~*sl&wI=x9-EGiq*aqV!(VVXA57 zw9*o6Ir8Lj1npUXvlevtn(_+^X5rzdR>#(}4YcB9O50q97%rW2me5_L=%ffYPUSRc z!vv?Kv>dH994Qi>U(a<0KF6NH5b16enCp+mw^Hb3Xs1^tThFpz!3QuN#}KBbww`(h z7GO)1olDqy6?T$()R7y%NYx*B0k_2IBiZ14&8|JPFxeMF{vSTxF-Vi3+ZOI=Thq2} zyQgjYY1_7^ZQHh{?P))4+qUiQJLi1&{yE>h?~jU%tjdV0h|FENbM3X(KnJdPKc?~k zh=^Ixv*+smUll!DTWH!jrV*wSh*(mx0o6}1@JExzF(#9FXgmTXVoU+>kDe68N)dkQ zH#_98Zv$}lQwjKL@yBd;U(UD0UCl322=pav<=6g>03{O_3oKTq;9bLFX1ia*lw;#K zOiYDcBJf)82->83N_Y(J7Kr_3lE)hAu;)Q(nUVydv+l+nQ$?|%MWTy`t>{havFSQloHwiIkGK9YZ79^9?AZo0ZyQlVR#}lF%dn5n%xYksXf8gnBm=wO7g_^! zauQ-bH1Dc@3ItZ-9D_*pH}p!IG7j8A_o94#~>$LR|TFq zZ-b00*nuw|-5C2lJDCw&8p5N~Z1J&TrcyErds&!l3$eSz%`(*izc;-?HAFD9AHb-| z>)id`QCrzRws^9(#&=pIx9OEf2rmlob8sK&xPCWS+nD~qzU|qG6KwA{zbikcfQrdH z+ zQg>O<`K4L8rN7`GJB0*3<3`z({lWe#K!4AZLsI{%z#ja^OpfjU{!{)x0ZH~RB0W5X zTwN^w=|nA!4PEU2=LR05x~}|B&ZP?#pNgDMwD*ajI6oJqv!L81gu=KpqH22avXf0w zX3HjbCI!n9>l046)5rr5&v5ja!xkKK42zmqHzPx$9Nn_MZk`gLeSLgC=LFf;H1O#B zn=8|^1iRrujHfbgA+8i<9jaXc;CQBAmQvMGQPhFec2H1knCK2x!T`e6soyrqCamX% zTQ4dX_E*8so)E*TB$*io{$c6X)~{aWfaqdTh=xEeGvOAN9H&-t5tEE-qso<+C!2>+ zskX51H-H}#X{A75wqFe-J{?o8Bx|>fTBtl&tcbdR|132Ztqu5X0i-pisB-z8n71%q%>EF}yy5?z=Ve`}hVh{Drv1YWL zW=%ug_&chF11gDv3D6B)Tz5g54H0mDHNjuKZ+)CKFk4Z|$RD zfRuKLW`1B>B?*RUfVd0+u8h3r-{@fZ{k)c!93t1b0+Q9vOaRnEn1*IL>5Z4E4dZ!7 ztp4GP-^1d>8~LMeb}bW!(aAnB1tM_*la=Xx)q(I0Y@__Zd$!KYb8T2VBRw%e$iSdZ zkwdMwd}eV9q*;YvrBFTv1>1+}{H!JK2M*C|TNe$ZSA>UHKk);wz$(F$rXVc|sI^lD zV^?_J!3cLM;GJuBMbftbaRUs$;F}HDEDtIeHQ)^EJJ1F9FKJTGH<(Jj`phE6OuvE) zqK^K`;3S{Y#1M@8yRQwH`?kHMq4tHX#rJ>5lY3DM#o@or4&^_xtBC(|JpGTfrbGkA z2Tu+AyT^pHannww!4^!$5?@5v`LYy~T`qs7SYt$JgrY(w%C+IWA;ZkwEF)u5sDvOK zGk;G>Mh&elvXDcV69J_h02l&O;!{$({fng9Rlc3ID#tmB^FIG^w{HLUpF+iB`|
NnX)EH+Nua)3Y(c z&{(nX_ht=QbJ%DzAya}!&uNu!4V0xI)QE$SY__m)SAKcN0P(&JcoK*Lxr@P zY&P=}&B3*UWNlc|&$Oh{BEqwK2+N2U$4WB7Fd|aIal`FGANUa9E-O)!gV`((ZGCc$ zBJA|FFrlg~9OBp#f7aHodCe{6= zay$6vN~zj1ddMZ9gQ4p32(7wD?(dE>KA2;SOzXRmPBiBc6g`eOsy+pVcHu=;Yd8@{ zSGgXf@%sKKQz~;!J;|2fC@emm#^_rnO0esEn^QxXgJYd`#FPWOUU5b;9eMAF zZhfiZb|gk8aJIw*YLp4!*(=3l8Cp{(%p?ho22*vN9+5NLV0TTazNY$B5L6UKUrd$n zjbX%#m7&F#U?QNOBXkiiWB*_tk+H?N3`vg;1F-I+83{M2!8<^nydGr5XX}tC!10&e z7D36bLaB56WrjL&HiiMVtpff|K%|*{t*ltt^5ood{FOG0<>k&1h95qPio)2`eL${YAGIx(b4VN*~nKn6E~SIQUuRH zQ+5zP6jfnP$S0iJ@~t!Ai3o`X7biohli;E zT#yXyl{bojG@-TGZzpdVDXhbmF%F9+-^YSIv|MT1l3j zrxOFq>gd2%U}?6}8mIj?M zc077Zc9fq(-)4+gXv?Az26IO6eV`RAJz8e3)SC7~>%rlzDwySVx*q$ygTR5kW2ds- z!HBgcq0KON9*8Ff$X0wOq$`T7ml(@TF)VeoF}x1OttjuVHn3~sHrMB++}f7f9H%@f z=|kP_?#+fve@{0MlbkC9tyvQ_R?lRdRJ@$qcB(8*jyMyeME5ns6ypVI1Xm*Zr{DuS zZ!1)rQfa89c~;l~VkCiHI|PCBd`S*2RLNQM8!g9L6?n`^evQNEwfO@&JJRme+uopQX0%Jo zgd5G&#&{nX{o?TQwQvF1<^Cg3?2co;_06=~Hcb6~4XWpNFL!WU{+CK;>gH%|BLOh7@!hsa(>pNDAmpcuVO-?;Bic17R}^|6@8DahH)G z!EmhsfunLL|3b=M0MeK2vqZ|OqUqS8npxwge$w-4pFVXFq$_EKrZY?BuP@Az@(k`L z`ViQBSk`y+YwRT;&W| z2e3UfkCo^uTA4}Qmmtqs+nk#gNr2W4 zTH%hhErhB)pkXR{B!q5P3-OM+M;qu~f>}IjtF%>w{~K-0*jPVLl?Chz&zIdxp}bjx zStp&Iufr58FTQ36AHU)0+CmvaOpKF;W@sMTFpJ`j;3d)J_$tNQI^c<^1o<49Z(~K> z;EZTBaVT%14(bFw2ob@?JLQ2@(1pCdg3S%E4*dJ}dA*v}_a4_P(a`cHnBFJxNobAv zf&Zl-Yt*lhn-wjZsq<9v-IsXxAxMZ58C@e0!rzhJ+D@9^3~?~yllY^s$?&oNwyH!#~6x4gUrfxplCvK#!f z$viuszW>MFEcFL?>ux*((!L$;R?xc*myjRIjgnQX79@UPD$6Dz0jutM@7h_pq z0Zr)#O<^y_K6jfY^X%A-ip>P%3saX{!v;fxT-*0C_j4=UMH+Xth(XVkVGiiKE#f)q z%Jp=JT)uy{&}Iq2E*xr4YsJ5>w^=#-mRZ4vPXpI6q~1aFwi+lQcimO45V-JXP;>(Q zo={U`{=_JF`EQj87Wf}{Qy35s8r1*9Mxg({CvOt}?Vh9d&(}iI-quvs-rm~P;eRA@ zG5?1HO}puruc@S{YNAF3vmUc2B4!k*yi))<5BQmvd3tr}cIs#9)*AX>t`=~{f#Uz0 z0&Nk!7sSZwJe}=)-R^$0{yeS!V`Dh7w{w5rZ9ir!Z7Cd7dwZcK;BT#V0bzTt>;@Cl z#|#A!-IL6CZ@eHH!CG>OO8!%G8&8t4)Ro@}USB*k>oEUo0LsljsJ-%5Mo^MJF2I8- z#v7a5VdJ-Cd%(a+y6QwTmi+?f8Nxtm{g-+WGL>t;s#epv7ug>inqimZCVm!uT5Pf6 ziEgQt7^%xJf#!aPWbuC_3Nxfb&CFbQy!(8ANpkWLI4oSnH?Q3f?0k1t$3d+lkQs{~(>06l&v|MpcFsyAv zin6N!-;pggosR*vV=DO(#+}4ps|5$`udE%Kdmp?G7B#y%H`R|i8skKOd9Xzx8xgR$>Zo2R2Ytktq^w#ul4uicxW#{ zFjG_RNlBroV_n;a7U(KIpcp*{M~e~@>Q#Av90Jc5v%0c>egEdY4v3%|K1XvB{O_8G zkTWLC>OZKf;XguMH2-Pw{BKbFzaY;4v2seZV0>^7Q~d4O=AwaPhP3h|!hw5aqOtT@ z!SNz}$of**Bl3TK209@F=Tn1+mgZa8yh(Png%Zd6Mt}^NSjy)etQrF zme*llAW=N_8R*O~d2!apJnF%(JcN??=`$qs3Y+~xs>L9x`0^NIn!8mMRFA_tg`etw z3k{9JAjnl@ygIiJcNHTy02GMAvBVqEss&t2<2mnw!; zU`J)0>lWiqVqo|ex7!+@0i>B~BSU1A_0w#Ee+2pJx0BFiZ7RDHEvE*ptc9md(B{&+ zKE>TM)+Pd>HEmdJao7U@S>nL(qq*A)#eLOuIfAS@j`_sK0UEY6OAJJ-kOrHG zjHx`g!9j*_jRcJ%>CE9K2MVf?BUZKFHY?EpV6ai7sET-tqk=nDFh-(65rhjtlKEY% z@G&cQ<5BKatfdA1FKuB=i>CCC5(|9TMW%K~GbA4}80I5%B}(gck#Wlq@$nO3%@QP_ z8nvPkJFa|znk>V92cA!K1rKtr)skHEJD;k8P|R8RkCq1Rh^&}Evwa4BUJz2f!2=MH zo4j8Y$YL2313}H~F7@J7mh>u%556Hw0VUOz-Un@ZASCL)y8}4XXS`t1AC*^>PLwIc zUQok5PFS=*#)Z!3JZN&eZ6ZDP^-c@StY*t20JhCnbMxXf=LK#;`4KHEqMZ-Ly9KsS zI2VUJGY&PmdbM+iT)zek)#Qc#_i4uH43 z@T5SZBrhNCiK~~esjsO9!qBpaWK<`>!-`b71Y5ReXQ4AJU~T2Njri1CEp5oKw;Lnm)-Y@Z3sEY}XIgSy%xo=uek(kAAH5MsV$V3uTUsoTzxp_rF=tx zV07vlJNKtJhCu`b}*#m&5LV4TAE&%KtHViDAdv#c^x`J7bg z&N;#I2GkF@SIGht6p-V}`!F_~lCXjl1BdTLIjD2hH$J^YFN`7f{Q?OHPFEM$65^!u zNwkelo*5+$ZT|oQ%o%;rBX$+?xhvjb)SHgNHE_yP%wYkkvXHS{Bf$OiKJ5d1gI0j< zF6N}Aq=(WDo(J{e-uOecxPD>XZ@|u-tgTR<972`q8;&ZD!cep^@B5CaqFz|oU!iFj zU0;6fQX&~15E53EW&w1s9gQQ~Zk16X%6 zjG`j0yq}4deX2?Tr(03kg>C(!7a|b9qFI?jcE^Y>-VhudI@&LI6Qa}WQ>4H_!UVyF z((cm&!3gmq@;BD#5P~0;_2qgZhtJS|>WdtjY=q zLnHH~Fm!cxw|Z?Vw8*~?I$g#9j&uvgm7vPr#&iZgPP~v~BI4jOv;*OQ?jYJtzO<^y z7-#C={r7CO810!^s(MT!@@Vz_SVU)7VBi(e1%1rvS!?PTa}Uv`J!EP3s6Y!xUgM^8 z4f!fq<3Wer_#;u!5ECZ|^c1{|q_lh3m^9|nsMR1#Qm|?4Yp5~|er2?W^7~cl;_r4WSme_o68J9p03~Hc%X#VcX!xAu%1`R!dfGJCp zV*&m47>s^%Ib0~-2f$6oSgn3jg8m%UA;ArcdcRyM5;}|r;)?a^D*lel5C`V5G=c~k zy*w_&BfySOxE!(~PI$*dwG><+-%KT5p?whOUMA*k<9*gi#T{h3DAxzAPxN&Xws8o9Cp*`PA5>d9*Z-ynV# z9yY*1WR^D8|C%I@vo+d8r^pjJ$>eo|j>XiLWvTWLl(^;JHCsoPgem6PvegHb-OTf| zvTgsHSa;BkbG=(NgPO|CZu9gUCGr$8*EoH2_Z#^BnxF0yM~t`|9ws_xZ8X8iZYqh! zAh;HXJ)3P&)Q0(&F>!LN0g#bdbis-cQxyGn9Qgh`q+~49Fqd2epikEUw9caM%V6WgP)532RMRW}8gNS%V%Hx7apSz}tn@bQy!<=lbhmAH=FsMD?leawbnP5BWM0 z5{)@EEIYMu5;u)!+HQWhQ;D3_Cm_NADNeb-f56}<{41aYq8p4=93d=-=q0Yx#knGYfXVt z+kMxlus}t2T5FEyCN~!}90O_X@@PQpuy;kuGz@bWft%diBTx?d)_xWd_-(!LmVrh**oKg!1CNF&LX4{*j|) zIvjCR0I2UUuuEXh<9}oT_zT#jOrJAHNLFT~Ilh9hGJPI1<5`C-WA{tUYlyMeoy!+U zhA#=p!u1R7DNg9u4|QfED-2TuKI}>p#2P9--z;Bbf4Op*;Q9LCbO&aL2i<0O$ByoI z!9;Ght733FC>Pz>$_mw(F`zU?`m@>gE`9_p*=7o=7av`-&ifU(^)UU`Kg3Kw`h9-1 z6`e6+im=|m2v`pN(2dE%%n8YyQz;#3Q-|x`91z?gj68cMrHl}C25|6(_dIGk*8cA3 zRHB|Nwv{@sP4W+YZM)VKI>RlB`n=Oj~Rzx~M+Khz$N$45rLn6k1nvvD^&HtsMA4`s=MmuOJID@$s8Ph4E zAmSV^+s-z8cfv~Yd(40Sh4JG#F~aB>WFoX7ykaOr3JaJ&Lb49=B8Vk-SQT9%7TYhv z?-Pprt{|=Y5ZQ1?od|A<_IJU93|l4oAfBm?3-wk{O<8ea+`}u%(kub(LFo2zFtd?4 zwpN|2mBNywv+d^y_8#<$r>*5+$wRTCygFLcrwT(qc^n&@9r+}Kd_u@Ithz(6Qb4}A zWo_HdBj#V$VE#l6pD0a=NfB0l^6W^g`vm^sta>Tly?$E&{F?TTX~DsKF~poFfmN%2 z4x`Dc{u{Lkqz&y!33;X}weD}&;7p>xiI&ZUb1H9iD25a(gI|`|;G^NwJPv=1S5e)j z;U;`?n}jnY6rA{V^ zxTd{bK)Gi^odL3l989DQlN+Zs39Xe&otGeY(b5>rlIqfc7Ap4}EC?j<{M=hlH{1+d zw|c}}yx88_xQr`{98Z!d^FNH77=u(p-L{W6RvIn40f-BldeF-YD>p6#)(Qzf)lfZj z?3wAMtPPp>vMehkT`3gToPd%|D8~4`5WK{`#+}{L{jRUMt zrFz+O$C7y8$M&E4@+p+oV5c%uYzbqd2Y%SSgYy#xh4G3hQv>V*BnuKQhBa#=oZB~w{azUB+q%bRe_R^ z>fHBilnRTUfaJ201czL8^~Ix#+qOHSO)A|xWLqOxB$dT2W~)e-r9;bm=;p;RjYahB z*1hegN(VKK+ztr~h1}YP@6cfj{e#|sS`;3tJhIJK=tVJ-*h-5y9n*&cYCSdg#EHE# zSIx=r#qOaLJoVVf6v;(okg6?*L_55atl^W(gm^yjR?$GplNP>BZsBYEf_>wM0Lc;T zhf&gpzOWNxS>m+mN92N0{;4uw`P+9^*|-1~$uXpggj4- z^SFc4`uzj2OwdEVT@}Q`(^EcQ_5(ZtXTql*yGzdS&vrS_w>~~ra|Nb5abwf}Y!uq6R5f&6g2ge~2p(%c< z@O)cz%%rr4*cRJ5f`n@lvHNk@lE1a*96Kw6lJ~B-XfJW%?&-y?;E&?1AacU@`N`!O z6}V>8^%RZ7SQnZ-z$(jsX`amu*5Fj8g!3RTRwK^`2_QHe;_2y_n|6gSaGyPmI#kA0sYV<_qOZc#-2BO%hX)f$s-Z3xlI!ub z^;3ru11DA`4heAu%}HIXo&ctujzE2!6DIGE{?Zs>2}J+p&C$rc7gJC35gxhflorvsb%sGOxpuWhF)dL_&7&Z99=5M0b~Qa;Mo!j&Ti_kXW!86N%n= zSC@6Lw>UQ__F&+&Rzv?gscwAz8IP!n63>SP)^62(HK98nGjLY2*e^OwOq`3O|C92? z;TVhZ2SK%9AGW4ZavTB9?)mUbOoF`V7S=XM;#3EUpR+^oHtdV!GK^nXzCu>tpR|89 zdD{fnvCaN^^LL%amZ^}-E+214g&^56rpdc@yv0b<3}Ys?)f|fXN4oHf$six)-@<;W&&_kj z-B}M5U*1sb4)77aR=@%I?|Wkn-QJVuA96an25;~!gq(g1@O-5VGo7y&E_srxL6ZfS z*R%$gR}dyONgju*D&?geiSj7SZ@ftyA|}(*Y4KbvU!YLsi1EDQQCnb+-cM=K1io78o!v*);o<XwjaQH%)uIP&Zm?)Nfbfn;jIr z)d#!$gOe3QHp}2NBak@yYv3m(CPKkwI|{;d=gi552u?xj9ObCU^DJFQp4t4e1tPzM zvsRIGZ6VF+{6PvqsplMZWhz10YwS={?`~O0Ec$`-!klNUYtzWA^f9m7tkEzCy<_nS z=&<(awFeZvt51>@o_~>PLs05CY)$;}Oo$VDO)?l-{CS1Co=nxjqben*O1BR>#9`0^ zkwk^k-wcLCLGh|XLjdWv0_Hg54B&OzCE^3NCP}~OajK-LuRW53CkV~Su0U>zN%yQP zH8UH#W5P3-!ToO-2k&)}nFe`t+mdqCxxAHgcifup^gKpMObbox9LFK;LP3}0dP-UW z?Zo*^nrQ6*$FtZ(>kLCc2LY*|{!dUn$^RW~m9leoF|@Jy|M5p-G~j%+P0_#orRKf8 zvuu5<*XO!B?1E}-*SY~MOa$6c%2cM+xa8}_8x*aVn~57v&W(0mqN1W`5a7*VN{SUH zXz98DDyCnX2EPl-`Lesf`=AQT%YSDb`$%;(jUTrNen$NPJrlpPDP}prI>Ml!r6bCT;mjsg@X^#&<}CGf0JtR{Ecwd&)2zuhr#nqdgHj+g2n}GK9CHuwO zk>oZxy{vcOL)$8-}L^iVfJHAGfwN$prHjYV0ju}8%jWquw>}_W6j~m<}Jf!G?~r5&Rx)!9JNX!ts#SGe2HzobV5); zpj@&`cNcO&q+%*<%D7za|?m5qlmFK$=MJ_iv{aRs+BGVrs)98BlN^nMr{V_fcl_;jkzRju+c-y?gqBC_@J0dFLq-D9@VN&-`R9U;nv$Hg?>$oe4N&Ht$V_(JR3TG^! zzJsbQbi zFE6-{#9{G{+Z}ww!ycl*7rRdmU#_&|DqPfX3CR1I{Kk;bHwF6jh0opI`UV2W{*|nn zf_Y@%wW6APb&9RrbEN=PQRBEpM(N1w`81s=(xQj6 z-eO0k9=Al|>Ej|Mw&G`%q8e$2xVz1v4DXAi8G};R$y)ww638Y=9y$ZYFDM$}vzusg zUf+~BPX>(SjA|tgaFZr_e0{)+z9i6G#lgt=F_n$d=beAt0Sa0a7>z-?vcjl3e+W}+ z1&9=|vC=$co}-Zh*%3588G?v&U7%N1Qf-wNWJ)(v`iO5KHSkC5&g7CrKu8V}uQGcfcz zmBz#Lbqwqy#Z~UzHgOQ;Q-rPxrRNvl(&u6ts4~0=KkeS;zqURz%!-ERppmd%0v>iRlEf+H$yl{_8TMJzo0 z>n)`On|7=WQdsqhXI?#V{>+~}qt-cQbokEbgwV3QvSP7&hK4R{Z{aGHVS3;+h{|Hz z6$Js}_AJr383c_+6sNR|$qu6dqHXQTc6?(XWPCVZv=)D#6_;D_8P-=zOGEN5&?~8S zl5jQ?NL$c%O)*bOohdNwGIKM#jSAC?BVY={@A#c9GmX0=T(0G}xs`-%f3r=m6-cpK z!%waekyAvm9C3%>sixdZj+I(wQlbB4wv9xKI*T13DYG^T%}zZYJ|0$Oj^YtY+d$V$ zAVudSc-)FMl|54n=N{BnZTM|!>=bhaja?o7s+v1*U$!v!qQ%`T-6fBvmdPbVmro&d zk07TOp*KuxRUSTLRrBj{mjsnF8`d}rMViY8j`jo~Hp$fkv9F_g(jUo#Arp;Xw0M$~ zRIN!B22~$kx;QYmOkos@%|5k)!QypDMVe}1M9tZfkpXKGOxvKXB!=lo`p?|R1l=tA zp(1}c6T3Fwj_CPJwVsYtgeRKg?9?}%oRq0F+r+kdB=bFUdVDRPa;E~~>2$w}>O>v=?|e>#(-Lyx?nbg=ckJ#5U6;RT zNvHhXk$P}m9wSvFyU3}=7!y?Y z=fg$PbV8d7g25&-jOcs{%}wTDKm>!Vk);&rr;O1nvO0VrU&Q?TtYVU=ir`te8SLlS zKSNmV=+vF|ATGg`4$N1uS|n??f}C_4Sz!f|4Ly8#yTW-FBfvS48Tef|-46C(wEO_%pPhUC5$-~Y?!0vFZ^Gu`x=m7X99_?C-`|h zfmMM&Y@zdfitA@KPw4Mc(YHcY1)3*1xvW9V-r4n-9ZuBpFcf{yz+SR{ zo$ZSU_|fgwF~aakGr(9Be`~A|3)B=9`$M-TWKipq-NqRDRQc}ABo*s_5kV%doIX7LRLRau_gd@Rd_aLFXGSU+U?uAqh z8qusWWcvgQ&wu{|sRXmv?sl=xc<$6AR$+cl& zFNh5q1~kffG{3lDUdvEZu5c(aAG~+64FxdlfwY^*;JSS|m~CJusvi-!$XR`6@XtY2 znDHSz7}_Bx7zGq-^5{stTRy|I@N=>*y$zz>m^}^{d&~h;0kYiq8<^Wq7Dz0w31ShO^~LUfW6rfitR0(=3;Uue`Y%y@ex#eKPOW zO~V?)M#AeHB2kovn1v=n^D?2{2jhIQd9t|_Q+c|ZFaWt+r&#yrOu-!4pXAJuxM+Cx z*H&>eZ0v8Y`t}8{TV6smOj=__gFC=eah)mZt9gwz>>W$!>b3O;Rm^Ig*POZP8Rl0f zT~o=Nu1J|lO>}xX&#P58%Yl z83`HRs5#32Qm9mdCrMlV|NKNC+Z~ z9OB8xk5HJ>gBLi+m@(pvpw)1(OaVJKs*$Ou#@Knd#bk+V@y;YXT?)4eP9E5{J%KGtYinNYJUH9PU3A}66c>Xn zZ{Bn0<;8$WCOAL$^NqTjwM?5d=RHgw3!72WRo0c;+houoUA@HWLZM;^U$&sycWrFd zE7ekt9;kb0`lps{>R(}YnXlyGY}5pPd9zBpgXeJTY_jwaJGSJQC#-KJqmh-;ad&F- z-Y)E>!&`Rz!HtCz>%yOJ|v(u7P*I$jqEY3}(Z-orn4 zlI?CYKNl`6I){#2P1h)y(6?i;^z`N3bxTV%wNvQW+eu|x=kbj~s8rhCR*0H=iGkSj zk23lr9kr|p7#qKL=UjgO`@UnvzU)`&fI>1Qs7ubq{@+lK{hH* zvl6eSb9%yngRn^T<;jG1SVa)eA>T^XX=yUS@NCKpk?ovCW1D@!=@kn;l_BrG;hOTC z6K&H{<8K#dI(A+zw-MWxS+~{g$tI7|SfP$EYKxA}LlVO^sT#Oby^grkdZ^^lA}uEF zBSj$weBJG{+Bh@Yffzsw=HyChS(dtLE3i*}Zj@~!_T-Ay7z=B)+*~3|?w`Zd)Co2t zC&4DyB!o&YgSw+fJn6`sn$e)29`kUwAc+1MND7YjV%lO;H2}fNy>hD#=gT ze+-aFNpyKIoXY~Vq-}OWPBe?Rfu^{ps8>Xy%42r@RV#*QV~P83jdlFNgkPN=T|Kt7 zV*M`Rh*30&AWlb$;ae130e@}Tqi3zx2^JQHpM>j$6x`#{mu%tZlwx9Gj@Hc92IuY* zarmT|*d0E~vt6<+r?W^UW0&#U&)8B6+1+;k^2|FWBRP9?C4Rk)HAh&=AS8FS|NQaZ z2j!iZ)nbEyg4ZTp-zHwVlfLC~tXIrv(xrP8PAtR{*c;T24ycA-;auWsya-!kF~CWZ zw_uZ|%urXgUbc@x=L=_g@QJ@m#5beS@6W195Hn7>_}z@Xt{DIEA`A&V82bc^#!q8$ zFh?z_Vn|ozJ;NPd^5uu(9tspo8t%&-U9Ckay-s@DnM*R5rtu|4)~e)`z0P-sy?)kc zs_k&J@0&0!q4~%cKL)2l;N*T&0;mqX5T{Qy60%JtKTQZ-xb%KOcgqwJmb%MOOKk7N zgq})R_6**{8A|6H?fO+2`#QU)p$Ei2&nbj6TpLSIT^D$|`TcSeh+)}VMb}LmvZ{O| ze*1IdCt3+yhdYVxcM)Q_V0bIXLgr6~%JS<<&dxIgfL=Vnx4YHuU@I34JXA|+$_S3~ zy~X#gO_X!cSs^XM{yzDGNM>?v(+sF#<0;AH^YrE8smx<36bUsHbN#y57K8WEu(`qHvQ6cAZPo=J5C(lSmUCZ57Rj6cx!e^rfaI5%w}unz}4 zoX=nt)FVNV%QDJH`o!u9olLD4O5fl)xp+#RloZlaA92o3x4->?rB4`gS$;WO{R;Z3>cG3IgFX2EA?PK^M}@%1%A;?f6}s&CV$cIyEr#q5;yHdNZ9h{| z-=dX+a5elJoDo?Eq&Og!nN6A)5yYpnGEp}?=!C-V)(*~z-+?kY1Q7qs#Rsy%hu_60rdbB+QQNr?S1 z?;xtjUv|*E3}HmuNyB9aFL5H~3Ho0UsmuMZELp1a#CA1g`P{-mT?BchuLEtK}!QZ=3AWakRu~?f9V~3F;TV`5%9Pcs_$gq&CcU}r8gOO zC2&SWPsSG{&o-LIGTBqp6SLQZPvYKp$$7L4WRRZ0BR$Kf0I0SCFkqveCp@f)o8W)! z$%7D1R`&j7W9Q9CGus_)b%+B#J2G;l*FLz#s$hw{BHS~WNLODV#(!u_2Pe&tMsq={ zdm7>_WecWF#D=?eMjLj=-_z`aHMZ=3_-&E8;ibPmM}61i6J3is*=dKf%HC>=xbj4$ zS|Q-hWQ8T5mWde6h@;mS+?k=89?1FU<%qH9B(l&O>k|u_aD|DY*@~(`_pb|B#rJ&g zR0(~(68fpUPz6TdS@4JT5MOPrqDh5_H(eX1$P2SQrkvN8sTxwV>l0)Qq z0pzTuvtEAKRDkKGhhv^jk%|HQ1DdF%5oKq5BS>szk-CIke{%js?~%@$uaN3^Uz6Wf z_iyx{bZ(;9y4X&>LPV=L=d+A}7I4GkK0c1Xts{rrW1Q7apHf-))`BgC^0^F(>At1* za@e7{lq%yAkn*NH8Q1{@{lKhRg*^TfGvv!Sn*ed*x@6>M%aaqySxR|oNadYt1mpUZ z6H(rupHYf&Z z29$5g#|0MX#aR6TZ$@eGxxABRKakDYtD%5BmKp;HbG_ZbT+=81E&=XRk6m_3t9PvD zr5Cqy(v?gHcYvYvXkNH@S#Po~q(_7MOuCAB8G$a9BC##gw^5mW16cML=T=ERL7wsk zzNEayTG?mtB=x*wc@ifBCJ|irFVMOvH)AFRW8WE~U()QT=HBCe@s$dA9O!@`zAAT) zaOZ7l6vyR+Nk_OOF!ZlZmjoImKh)dxFbbR~z(cMhfeX1l7S_`;h|v3gI}n9$sSQ>+3@AFAy9=B_y$)q;Wdl|C-X|VV3w8 z2S#>|5dGA8^9%Bu&fhmVRrTX>Z7{~3V&0UpJNEl0=N32euvDGCJ>#6dUSi&PxFW*s zS`}TB>?}H(T2lxBJ!V#2taV;q%zd6fOr=SGHpoSG*4PDaiG0pdb5`jelVipkEk%FV zThLc@Hc_AL1#D&T4D=w@UezYNJ%0=f3iVRuVL5H?eeZM}4W*bomebEU@e2d`M<~uW zf#Bugwf`VezG|^Qbt6R_=U0}|=k;mIIakz99*>FrsQR{0aQRP6ko?5<7bkDN8evZ& zB@_KqQG?ErKL=1*ZM9_5?Pq%lcS4uLSzN(Mr5=t6xHLS~Ym`UgM@D&VNu8e?_=nSFtF$u@hpPSmI4Vo_t&v?>$~K4y(O~Rb*(MFy_igM7 z*~yYUyR6yQgzWnWMUgDov!!g=lInM+=lOmOk4L`O?{i&qxy&D*_qorRbDwj6?)!ef z#JLd7F6Z2I$S0iYI={rZNk*<{HtIl^mx=h>Cim*04K4+Z4IJtd*-)%6XV2(MCscPiw_a+y*?BKbTS@BZ3AUao^%Zi#PhoY9Vib4N>SE%4>=Jco0v zH_Miey{E;FkdlZSq)e<{`+S3W=*ttvD#hB8w=|2aV*D=yOV}(&p%0LbEWH$&@$X3x~CiF-?ejQ*N+-M zc8zT@3iwkdRT2t(XS`d7`tJQAjRmKAhiw{WOqpuvFp`i@Q@!KMhwKgsA}%@sw8Xo5Y=F zhRJZg)O4uqNWj?V&&vth*H#je6T}}p_<>!Dr#89q@uSjWv~JuW(>FqoJ5^ho0%K?E z9?x_Q;kmcsQ@5=}z@tdljMSt9-Z3xn$k)kEjK|qXS>EfuDmu(Z8|(W?gY6-l z@R_#M8=vxKMAoi&PwnaIYw2COJM@atcgfr=zK1bvjW?9B`-+Voe$Q+H$j!1$Tjn+* z&LY<%)L@;zhnJlB^Og6I&BOR-m?{IW;tyYC%FZ!&Z>kGjHJ6cqM-F z&19n+e1=9AH1VrVeHrIzqlC`w9=*zfmrerF?JMzO&|Mmv;!4DKc(sp+jy^Dx?(8>1 zH&yS_4yL7m&GWX~mdfgH*AB4{CKo;+egw=PrvkTaoBU+P-4u?E|&!c z)DKc;>$$B6u*Zr1SjUh2)FeuWLWHl5TH(UHWkf zLs>7px!c5n;rbe^lO@qlYLzlDVp(z?6rPZel=YB)Uv&n!2{+Mb$-vQl=xKw( zve&>xYx+jW_NJh!FV||r?;hdP*jOXYcLCp>DOtJ?2S^)DkM{{Eb zS$!L$e_o0(^}n3tA1R3-$SNvgBq;DOEo}fNc|tB%%#g4RA3{|euq)p+xd3I8^4E&m zFrD%}nvG^HUAIKe9_{tXB;tl|G<%>yk6R;8L2)KUJw4yHJXUOPM>(-+jxq4R;z8H#>rnJy*)8N+$wA$^F zN+H*3t)eFEgxLw+Nw3};4WV$qj&_D`%ADV2%r zJCPCo%{=z7;`F98(us5JnT(G@sKTZ^;2FVitXyLe-S5(hV&Ium+1pIUB(CZ#h|g)u zSLJJ<@HgrDiA-}V_6B^x1>c9B6%~847JkQ!^KLZ2skm;q*edo;UA)~?SghG8;QbHh z_6M;ouo_1rq9=x$<`Y@EA{C%6-pEV}B(1#sDoe_e1s3^Y>n#1Sw;N|}8D|s|VPd+g z-_$QhCz`vLxxrVMx3ape1xu3*wjx=yKSlM~nFgkNWb4?DDr*!?U)L_VeffF<+!j|b zZ$Wn2$TDv3C3V@BHpSgv3JUif8%hk%OsGZ=OxH@8&4`bbf$`aAMchl^qN>Eyu3JH} z9-S!x8-s4fE=lad%Pkp8hAs~u?|uRnL48O|;*DEU! zuS0{cpk%1E0nc__2%;apFsTm0bKtd&A0~S3Cj^?72-*Owk3V!ZG*PswDfS~}2<8le z5+W^`Y(&R)yVF*tU_s!XMcJS`;(Tr`J0%>p=Z&InR%D3@KEzzI+-2)HK zuoNZ&o=wUC&+*?ofPb0a(E6(<2Amd6%uSu_^-<1?hsxs~0K5^f(LsGqgEF^+0_H=uNk9S0bb!|O8d?m5gQjUKevPaO+*VfSn^2892K~%crWM8+6 z25@V?Y@J<9w%@NXh-2!}SK_(X)O4AM1-WTg>sj1{lj5@=q&dxE^9xng1_z9w9DK>| z6Iybcd0e zyi;Ew!KBRIfGPGytQ6}z}MeXCfLY0?9%RiyagSp_D1?N&c{ zyo>VbJ4Gy`@Fv+5cKgUgs~na$>BV{*em7PU3%lloy_aEovR+J7TfQKh8BJXyL6|P8un-Jnq(ghd!_HEOh$zlv2$~y3krgeH;9zC}V3f`uDtW(%mT#944DQa~^8ZI+zAUu4U(j0YcDfKR$bK#gvn_{JZ>|gZ5+)u?T$w7Q%F^;!Wk?G z(le7r!ufT*cxS}PR6hIVtXa)i`d$-_1KkyBU>qmgz-=T};uxx&sKgv48akIWQ89F{ z0XiY?WM^~;|T8zBOr zs#zuOONzH?svv*jokd5SK8wG>+yMC)LYL|vLqm^PMHcT=`}V$=nIRHe2?h)8WQa6O zPAU}d`1y(>kZiP~Gr=mtJLMu`i<2CspL|q2DqAgAD^7*$xzM`PU4^ga`ilE134XBQ z99P(LhHU@7qvl9Yzg$M`+dlS=x^(m-_3t|h>S}E0bcFMn=C|KamQ)=w2^e)35p`zY zRV8X?d;s^>Cof2SPR&nP3E+-LCkS0J$H!eh8~k0qo$}00b=7!H_I2O+Ro@3O$nPdm ztmbOO^B+IHzQ5w>@@@J4cKw5&^_w6s!s=H%&byAbUtczPQ7}wfTqxxtQNfn*u73Qw zGuWsrky_ajPx-5`R<)6xHf>C(oqGf_Fw|-U*GfS?xLML$kv;h_pZ@Kk$y0X(S+K80 z6^|z)*`5VUkawg}=z`S;VhZhxyDfrE0$(PMurAxl~<>lfZa>JZ288ULK7D` zl9|#L^JL}Y$j*j`0-K6kH#?bRmg#5L3iB4Z)%iF@SqT+Lp|{i`m%R-|ZE94Np7Pa5 zCqC^V3}B(FR340pmF*qaa}M}+h6}mqE~7Sh!9bDv9YRT|>vBNAqv09zXHMlcuhKD| zcjjA(b*XCIwJ33?CB!+;{)vX@9xns_b-VO{i0y?}{!sdXj1GM8+$#v>W7nw;+O_9B z_{4L;C6ol?(?W0<6taGEn1^uG=?Q3i29sE`RfYCaV$3DKc_;?HsL?D_fSYg}SuO5U zOB_f4^vZ_x%o`5|C@9C5+o=mFy@au{s)sKw!UgC&L35aH(sgDxRE2De%(%OT=VUdN ziVLEmdOvJ&5*tCMKRyXctCwQu_RH%;m*$YK&m;jtbdH#Ak~13T1^f89tn`A%QEHWs~jnY~E}p_Z$XC z=?YXLCkzVSK+Id`xZYTegb@W8_baLt-Fq`Tv|=)JPbFsKRm)4UW;yT+J`<)%#ue9DPOkje)YF2fsCilK9MIIK>p*`fkoD5nGfmLwt)!KOT+> zOFq*VZktDDyM3P5UOg`~XL#cbzC}eL%qMB=Q5$d89MKuN#$6|4gx_Jt0Gfn8w&q}%lq4QU%6#jT*MRT% zrLz~C8FYKHawn-EQWN1B75O&quS+Z81(zN)G>~vN8VwC+e+y(`>HcxC{MrJ;H1Z4k zZWuv$w_F0-Ub%MVcpIc){4PGL^I7M{>;hS?;eH!;gmcOE66z3;Z1Phqo(t zVP(Hg6q#0gIKgsg7L7WE!{Y#1nI(45tx2{$34dDd#!Z0NIyrm)HOn5W#7;f4pQci# zDW!FI(g4e668kI9{2+mLwB+=#9bfqgX%!B34V-$wwSN(_cm*^{y0jQtv*4}eO^sOV z*9xoNvX)c9isB}Tgx&ZRjp3kwhTVK?r9;n!x>^XYT z@Q^7zp{rkIs{2mUSE^2!Gf6$6;j~&4=-0cSJJDizZp6LTe8b45;{AKM%v99}{{FfC zz709%u0mC=1KXTo(=TqmZQ;c?$M3z(!xah>aywrj40sc2y3rKFw4jCq+Y+u=CH@_V zxz|qeTwa>+<|H%8Dz5u>ZI5MmjTFwXS-Fv!TDd*`>3{krWoNVx$<133`(ftS?ZPyY z&4@ah^3^i`vL$BZa>O|Nt?ucewzsF)0zX3qmM^|waXr=T0pfIb0*$AwU=?Ipl|1Y; z*Pk6{C-p4MY;j@IJ|DW>QHZQJcp;Z~?8(Q+Kk3^0qJ}SCk^*n4W zu9ZFwLHUx-$6xvaQ)SUQcYd6fF8&x)V`1bIuX@>{mE$b|Yd(qomn3;bPwnDUc0F=; zh*6_((%bqAYQWQ~odER?h>1mkL4kpb3s7`0m@rDKGU*oyF)$j~Ffd4fXV$?`f~rHf zB%Y)@5SXZvfwm10RY5X?TEo)PK_`L6qgBp=#>fO49$D zDq8Ozj0q6213tV5Qq=;fZ0$|KroY{Dz=l@lU^J)?Ko@ti20TRplXzphBi>XGx4bou zEWrkNjz0t5j!_ke{g5I#PUlEU$Km8g8TE|XK=MkU@PT4T><2OVamoK;wJ}3X0L$vX zgd7gNa359*nc)R-0!`2X@FOTB`+oETOPc=ubp5R)VQgY+5BTZZJ2?9QwnO=dnulIUF3gFn;BODC2)65)HeVd%t86sL7Rv^Y+nbn+&l z6BAJY(ETvwI)Ts$aiE8rht4KD*qNyE{8{x6R|%akbTBzw;2+6Echkt+W+`u^XX z_z&x%n*=4<|!MJu@}isLc4AW#{m2if&A5T5g&~ ziuMQeS*U5sL6J698wOd)K@oK@1{peP5&Esut<#VH^u)gp`9H4)`uE!2$>RTctN+^u z=ASkePDZA-X8)rp%D;p*~P?*a_=*Kwc<^>QSH|^<0>o37lt^+Mj1;4YvJ(JR-Y+?%Nu}JAYj5 z_Qc5%Ao#F?q32i?ZaN2OSNhWL;2oDEw_({7ZbgUjna!Fqn3NzLM@-EWFPZVmc>(fZ z0&bF-Ch#p9C{YJT9Rcr3+Y_uR^At1^BxZ#eo>$PLJF3=;t_$2|t+_6gg5(j{TmjYU zK12c&lE?Eh+2u2&6Gf*IdKS&6?rYbSEKBN!rv{YCm|Rt=UlPcW9j`0o6{66#y5t9C zruFA2iKd=H%jHf%ypOkxLnO8#H}#Zt{8p!oi6)7#NqoF({t6|J^?1e*oxqng9Q2Cc zg%5Vu!em)}Yuj?kaP!D?b?(C*w!1;>R=j90+RTkyEXz+9CufZ$C^umX^+4|JYaO<5 zmIM3#dv`DGM;@F6;(t!WngZSYzHx?9&$xEF70D1BvfVj<%+b#)vz)2iLCrTeYzUcL z(OBnNoG6Le%M+@2oo)&jdOg=iCszzv59e zDRCeaX8l1hC=8LbBt|k5?CXgep=3r9BXx1uR8!p%Z|0+4Xro=xi0G!e{c4U~1j6!) zH6adq0}#l{%*1U(Cb%4AJ}VLWKBPi0MoKFaQH6x?^hQ!6em@993xdtS%_dmevzeNl z(o?YlOI=jl(`L9^ z0O+H9k$_@`6L13eTT8ci-V0ljDMD|0ifUw|Q-Hep$xYj0hTO@0%IS^TD4b4n6EKDG z??uM;MEx`s98KYN(K0>c!C3HZdZ{+_53DO%9k5W%pr6yJusQAv_;IA}925Y%;+!tY z%2k!YQmLLOr{rF~!s<3-WEUs)`ix_mSU|cNRBIWxOox_Yb7Z=~Q45ZNe*u|m^|)d* zog=i>`=bTe!|;8F+#H>EjIMcgWcG2ORD`w0WD;YZAy5#s{65~qfI6o$+Ty&-hyMyJ z3Ra~t>R!p=5ZpxA;QkDAoPi4sYOP6>LT+}{xp}tk+<0k^CKCFdNYG(Es>p0gqD)jP zWOeX5G;9(m@?GOG7g;e74i_|SmE?`B2i;sLYwRWKLy0RLW!Hx`=!LH3&k=FuCsM=9M4|GqzA)anEHfxkB z?2iK-u(DC_T1};KaUT@3nP~LEcENT^UgPvp!QC@Dw&PVAhaEYrPey{nkcn(ro|r7XUz z%#(=$7D8uP_uU-oPHhd>>^adbCSQetgSG`e$U|7mr!`|bU0aHl_cmL)na-5x1#OsVE#m*+k84Y^+UMeSAa zbrVZHU=mFwXEaGHtXQq`2ZtjfS!B2H{5A<3(nb-6ARVV8kEmOkx6D2x7~-6hl;*-*}2Xz;J#a8Wn;_B5=m zl3dY;%krf?i-Ok^Pal-}4F`{F@TYPTwTEhxpZK5WCpfD^UmM_iYPe}wpE!Djai6_{ z*pGO=WB47#Xjb7!n2Ma)s^yeR*1rTxp`Mt4sfA+`HwZf%!7ZqGosPkw69`Ix5Ku6G z@Pa;pjzV&dn{M=QDx89t?p?d9gna*}jBly*#1!6}5K<*xDPJ{wv4& zM$17DFd~L*Te3A%yD;Dp9UGWTjRxAvMu!j^Tbc}2v~q^59d4bz zvu#!IJCy(BcWTc`;v$9tH;J%oiSJ_i7s;2`JXZF+qd4C)vY!hyCtl)sJIC{ebI*0> z@x>;EzyBv>AI-~{D6l6{ST=em*U( z(r$nuXY-#CCi^8Z2#v#UXOt`dbYN1z5jzNF2 z411?w)whZrfA20;nl&C1Gi+gk<`JSm+{|*2o<< zqM#@z_D`Cn|0H^9$|Tah)0M_X4c37|KQ*PmoT@%xHc3L1ZY6(p(sNXHa&49Frzto& zR`c~ClHpE~4Z=uKa5S(-?M8EJ$zt0&fJk~p$M#fGN1-y$7!37hld`Uw>Urri(DxLa;=#rK0g4J)pXMC zxzraOVw1+kNWpi#P=6(qxf`zSdUC?D$i`8ZI@F>k6k zz21?d+dw7b&i*>Kv5L(LH-?J%@WnqT7j#qZ9B>|Zl+=> z^U-pV@1y_ptHo4hl^cPRWewbLQ#g6XYQ@EkiP z;(=SU!yhjHp%1&MsU`FV1Z_#K1&(|5n(7IHbx&gG28HNT)*~-BQi372@|->2Aw5It z0CBpUcMA*QvsPy)#lr!lIdCi@1k4V2m!NH)%Px(vu-r(Q)HYc!p zJ^$|)j^E#q#QOgcb^pd74^JUi7fUmMiNP_o*lvx*q%_odv49Dsv$NV;6J z9GOXKomA{2Pb{w}&+yHtH?IkJJu~}Z?{Uk++2mB8zyvh*xhHKE``99>y#TdD z&(MH^^JHf;g(Tbb^&8P*;_i*2&fS$7${3WJtV7K&&(MBV2~)2KB3%cWg#1!VE~k#C z!;A;?p$s{ihyojEZz+$I1)L}&G~ml=udD9qh>Tu(ylv)?YcJT3ihapi!zgPtWb*CP zlLLJSRCj-^w?@;RU9aL2zDZY1`I3d<&OMuW=c3$o0#STpv_p3b9Wtbql>w^bBi~u4 z3D8KyF?YE?=HcKk!xcp@Cigvzy=lnFgc^9c%(^F22BWYNAYRSho@~*~S)4%AhEttv zvq>7X!!EWKG?mOd9&n>vvH1p4VzE?HCuxT-u+F&mnsfDI^}*-d00-KAauEaXqg3k@ zy#)MGX!X;&3&0s}F3q40ZmVM$(H3CLfpdL?hB6nVqMxX)q=1b}o_PG%r~hZ4gUfSp zOH4qlEOW4OMUc)_m)fMR_rl^pCfXc{$fQbI*E&mV77}kRF z&{<06AJyJ!e863o-V>FA1a9Eemx6>^F$~9ppt()ZbPGfg_NdRXBWoZnDy2;#ODgf! zgl?iOcF7Meo|{AF>KDwTgYrJLb$L2%%BEtO>T$C?|9bAB&}s;gI?lY#^tttY&hfr# zKhC+&b-rpg_?~uVK%S@mQleU#_xCsvIPK*<`E0fHE1&!J7!xD#IB|SSPW6-PyuqGn3^M^Rz%WT{e?OI^svARX&SAdU77V(C~ zM$H{Kg59op{<|8ry9ecfP%=kFm(-!W&?U0@<%z*+!*<e0XesMxRFu9QnGqun6R_%T+B%&9Dtk?*d$Q zb~>84jEAPi@&F@3wAa^Lzc(AJz5gsfZ7J53;@D<;Klpl?sK&u@gie`~vTsbOE~Cd4 z%kr56mI|#b(Jk&;p6plVwmNB0H@0SmgdmjIn5Ne@)}7Vty(yb2t3ev@22AE^s!KaN zyQ>j+F3w=wnx7w@FVCRe+`vUH)3gW%_72fxzqX!S&!dchdkRiHbXW1FMrIIBwjsai8`CB2r4mAbwp%rrO>3B$Zw;9=%fXI9B{d(UzVap7u z6piC-FQ)>}VOEuPpuqznpY`hN4dGa_1Xz9rVg(;H$5Te^F0dDv*gz9JS<|>>U0J^# z6)(4ICh+N_Q`Ft0hF|3fSHs*?a=XC;e`sJaU9&d>X4l?1W=|fr!5ShD|nv$GK;j46@BV6+{oRbWfqOBRb!ir88XD*SbC(LF}I1h#6@dvK%Toe%@ zhDyG$93H8Eu&gCYddP58iF3oQH*zLbNI;rN@E{T9%A8!=v#JLxKyUe}e}BJpB{~uN zqgxRgo0*-@-iaHPV8bTOH(rS(huwK1Xg0u+e!`(Irzu@Bld&s5&bWgVc@m7;JgELd zimVs`>vQ}B_1(2#rv#N9O`fJpVfPc7V2nv34PC);Dzbb;p!6pqHzvy?2pD&1NE)?A zt(t-ucqy@wn9`^MN5apa7K|L=9>ISC>xoc#>{@e}m#YAAa1*8-RUMKwbm|;5p>T`Z zNf*ph@tnF{gmDa3uwwN(g=`Rh)4!&)^oOy@VJaK4lMT&5#YbXkl`q?<*XtsqD z9PRK6bqb)fJw0g-^a@nu`^?71k|m3RPRjt;pIkCo1{*pdqbVs-Yl>4E>3fZx3Sv44grW=*qdSoiZ9?X0wWyO4`yDHh2E!9I!ZFi zVL8|VtW38}BOJHW(Ax#KL_KQzarbuE{(%TA)AY)@tY4%A%P%SqIU~8~-Lp3qY;U-} z`h_Gel7;K1h}7$_5ZZT0&%$Lxxr-<89V&&TCsu}LL#!xpQ1O31jaa{U34~^le*Y%L za?7$>Jk^k^pS^_M&cDs}NgXlR>16AHkSK-4TRaJSh#h&p!-!vQY%f+bmn6x`4fwTp z$727L^y`~!exvmE^W&#@uY!NxJi`g!i#(++!)?iJ(1)2Wk;RN zFK&O4eTkP$Xn~4bB|q8y(btx$R#D`O@epi4ofcETrx!IM(kWNEe42Qh(8*KqfP(c0 zouBl6>Fc_zM+V;F3znbo{x#%!?mH3`_ANJ?y7ppxS@glg#S9^MXu|FM&ynpz3o&Qh z2ujAHLF3($pH}0jXQsa#?t--TnF1P73b?4`KeJ9^qK-USHE)4!IYgMn-7z|=ALF5SNGkrtPG@Y~niUQV2?g$vzJN3nZ{7;HZHzWAeQ;5P|@Tl3YHpyznGG4-f4=XflwSJY+58-+wf?~Fg@1p1wkzuu-RF3j2JX37SQUc? zQ4v%`V8z9ZVZVqS8h|@@RpD?n0W<=hk=3Cf8R?d^9YK&e9ZybFY%jdnA)PeHvtBe- zhMLD+SSteHBq*q)d6x{)s1UrsO!byyLS$58WK;sqip$Mk{l)Y(_6hEIBsIjCr5t>( z7CdKUrJTrW%qZ#1z^n*Lb8#VdfzPw~OIL76aC+Rhr<~;4Tl!sw?Rj6hXj4XWa#6Tp z@)kJ~qOV)^Rh*-?aG>ic2*NlC2M7&LUzc9RT6WM%Cpe78`iAowe!>(T0jo&ivn8-7 zs{Qa@cGy$rE-3AY0V(l8wjI^uB8Lchj@?L}fYal^>T9z;8juH@?rG&g-t+R2dVDBe zq!K%{e-rT5jX19`(bP23LUN4+_zh2KD~EAYzhpEO3MUG8@}uBHH@4J zd`>_(K4q&>*k82(dDuC)X6JuPrBBubOg7qZ{?x!r@{%0);*`h*^F|%o?&1wX?Wr4b z1~&cy#PUuES{C#xJ84!z<1tp9sfrR(i%Tu^jnXy;4`Xk;AQCdFC@?V%|; zySdC7qS|uQRcH}EFZH%mMB~7gi}a0utE}ZE_}8PQH8f;H%PN41Cb9R%w5Oi5el^fd z$n{3SqLCnrF##x?4sa^r!O$7NX!}&}V;0ZGQ&K&i%6$3C_dR%I7%gdQ;KT6YZiQrW zk%q<74oVBV>@}CvJ4Wj!d^?#Zwq(b$E1ze4$99DuNg?6t9H}k_|D7KWD7i0-g*EO7 z;5{hSIYE4DMOK3H%|f5Edx+S0VI0Yw!tsaRS2&Il2)ea^8R5TG72BrJue|f_{2UHa z@w;^c|K3da#$TB0P3;MPlF7RuQeXT$ zS<<|C0OF(k)>fr&wOB=gP8!Qm>F41u;3esv7_0l%QHt(~+n; zf!G6%hp;Gfa9L9=AceiZs~tK+Tf*Wof=4!u{nIO90jH@iS0l+#%8=~%ASzFv7zqSB^?!@N7)kp0t&tCGLmzXSRMRyxCmCYUD2!B`? zhs$4%KO~m=VFk3Buv9osha{v+mAEq=ik3RdK@;WWTV_g&-$U4IM{1IhGX{pAu%Z&H zFfwCpUsX%RKg);B@7OUzZ{Hn{q6Vv!3#8fAg!P$IEx<0vAx;GU%}0{VIsmFBPq_mb zpe^BChDK>sc-WLKl<6 zwbW|e&d&dv9Wu0goueyu>(JyPx1mz0v4E?cJjFuKF71Q1)AL8jHO$!fYT3(;U3Re* zPPOe%*O+@JYt1bW`!W_1!mN&=w3G9ru1XsmwfS~BJ))PhD(+_J_^N6j)sx5VwbWK| zwRyC?W<`pOCY)b#AS?rluxuuGf-AJ=D!M36l{ua?@SJ5>e!IBr3CXIxWw5xUZ@Xrw z_R@%?{>d%Ld4p}nEsiA@v*nc6Ah!MUs?GA7e5Q5lPpp0@`%5xY$C;{%rz24$;vR#* zBP=a{)K#CwIY%p} zXVdxTQ^HS@O&~eIftU+Qt^~(DGxrdi3k}DdT^I7Iy5SMOp$QuD8s;+93YQ!OY{eB24%xY7ml@|M7I(Nb@K_-?F;2?et|CKkuZK_>+>Lvg!>JE~wN`BI|_h6$qi!P)+K-1Hh(1;a`os z55)4Q{oJiA(lQM#;w#Ta%T0jDNXIPM_bgESMCDEg6rM33anEr}=|Fn6)|jBP6Y}u{ zv9@%7*#RI9;fv;Yii5CI+KrRdr0DKh=L>)eO4q$1zmcSmglsV`*N(x=&Wx`*v!!hn6X-l0 zP_m;X??O(skcj+oS$cIdKhfT%ABAzz3w^la-Ucw?yBPEC+=Pe_vU8nd-HV5YX6X8r zZih&j^eLU=%*;VzhUyoLF;#8QsEfmByk+Y~caBqSvQaaWf2a{JKB9B>V&r?l^rXaC z8)6AdR@Qy_BxQrE2Fk?ewD!SwLuMj@&d_n5RZFf7=>O>hzVE*seW3U?_p|R^CfoY`?|#x9)-*yjv#lo&zP=uI`M?J zbzC<^3x7GfXA4{FZ72{PE*-mNHyy59Q;kYG@BB~NhTd6pm2Oj=_ zizmD?MKVRkT^KmXuhsk?eRQllPo2Ubk=uCKiZ&u3Xjj~<(!M94c)Tez@9M1Gfs5JV z->@II)CDJOXTtPrQudNjE}Eltbjq>6KiwAwqvAKd^|g!exgLG3;wP+#mZYr`cy3#39e653d=jrR-ulW|h#ddHu(m9mFoW~2yE zz5?dB%6vF}+`-&-W8vy^OCxm3_{02royjvmwjlp+eQDzFVEUiyO#gLv%QdDSI#3W* z?3!lL8clTaNo-DVJw@ynq?q!%6hTQi35&^>P85G$TqNt78%9_sSJt2RThO|JzM$iL zg|wjxdMC2|Icc5rX*qPL(coL!u>-xxz-rFiC!6hD1IR%|HSRsV3>Kq~&vJ=s3M5y8SG%YBQ|{^l#LGlg!D?E>2yR*eV%9m$_J6VGQ~AIh&P$_aFbh zULr0Z$QE!QpkP=aAeR4ny<#3Fwyw@rZf4?Ewq`;mCVv}xaz+3ni+}a=k~P+yaWt^L z@w67!DqVf7D%7XtXX5xBW;Co|HvQ8WR1k?r2cZD%U;2$bsM%u8{JUJ5Z0k= zZJARv^vFkmWx15CB=rb=D4${+#DVqy5$C%bf`!T0+epLJLnh1jwCdb*zuCL}eEFvE z{rO1%gxg>1!W(I!owu*mJZ0@6FM(?C+d*CeceZRW_4id*D9p5nzMY&{mWqrJomjIZ z97ZNnZ3_%Hx8dn;H>p8m7F#^2;T%yZ3H;a&N7tm=Lvs&lgJLW{V1@h&6Vy~!+Ffbb zv(n3+v)_D$}dqd!2>Y2B)#<+o}LH#%ogGi2-?xRIH)1!SD)u-L65B&bsJTC=LiaF+YOCif2dUX6uAA|#+vNR z>U+KQekVGon)Yi<93(d!(yw1h3&X0N(PxN2{%vn}cnV?rYw z$N^}_o!XUB!mckL`yO1rnUaI4wrOeQ(+&k?2mi47hzxSD`N#-byqd1IhEoh!PGq>t z_MRy{5B0eKY>;Ao3z$RUU7U+i?iX^&r739F)itdrTpAi-NN0=?^m%?{A9Ly2pVv>Lqs6moTP?T2-AHqFD-o_ znVr|7OAS#AEH}h8SRPQ@NGG47dO}l=t07__+iK8nHw^(AHx&Wb<%jPc$$jl6_p(b$ z)!pi(0fQodCHfM)KMEMUR&UID>}m^(!{C^U7sBDOA)$VThRCI0_+2=( zV8mMq0R(#z;C|7$m>$>`tX+T|xGt(+Y48@ZYu#z;0pCgYgmMVbFb!$?%yhZqP_nhn zy4<#3P1oQ#2b51NU1mGnHP$cf0j-YOgAA}A$QoL6JVLcmExs(kU{4z;PBHJD%_=0F z>+sQV`mzijSIT7xn%PiDKHOujX;n|M&qr1T@rOxTdxtZ!&u&3HHFLYD5$RLQ=heur zb>+AFokUVQeJy-#LP*^)spt{mb@Mqe=A~-4p0b+Bt|pZ+@CY+%x}9f}izU5;4&QFE zO1bhg&A4uC1)Zb67kuowWY4xbo&J=%yoXlFB)&$d*-}kjBu|w!^zbD1YPc0-#XTJr z)pm2RDy%J3jlqSMq|o%xGS$bPwn4AqitC6&e?pqWcjWPt{3I{>CBy;hg0Umh#c;hU3RhCUX=8aR>rmd` z7Orw(5tcM{|-^J?ZAA9KP|)X6n9$-kvr#j5YDecTM6n z&07(nD^qb8hpF0B^z^pQ*%5ePYkv&FabrlI61ntiVp!!C8y^}|<2xgAd#FY=8b*y( zuQOuvy2`Ii^`VBNJB&R!0{hABYX55ooCAJSSevl4RPqEGb)iy_0H}v@vFwFzD%>#I>)3PsouQ+_Kkbqy*kKdHdfkN7NBcq%V{x^fSxgXpg7$bF& zj!6AQbDY(1u#1_A#1UO9AxiZaCVN2F0wGXdY*g@x$ByvUA?ePdide0dmr#}udE%K| z3*k}Vv2Ew2u1FXBaVA6aerI36R&rzEZeDDCl5!t0J=ug6kuNZzH>3i_VN`%BsaVB3 zQYw|Xub_SGf{)F{$ZX5`Jc!X!;eybjP+o$I{Z^Hsj@D=E{MnnL+TbC@HEU2DjG{3-LDGIbq()U87x4eS;JXnSh;lRlJ z>EL3D>wHt-+wTjQF$fGyDO$>d+(fq@bPpLBS~xA~R=3JPbS{tzN(u~m#Po!?H;IYv zE;?8%^vle|%#oux(Lj!YzBKv+Fd}*Ur-dCBoX*t{KeNM*n~ZPYJ4NNKkI^MFbz9!v z4(Bvm*Kc!-$%VFEewYJKz-CQN{`2}KX4*CeJEs+Q(!kI%hN1!1P6iOq?ovz}X0IOi z)YfWpwW@pK08^69#wSyCZkX9?uZD?C^@rw^Y?gLS_xmFKkooyx$*^5#cPqntNTtSG zlP>XLMj2!VF^0k#ole7`-c~*~+_T5ls?x4)ah(j8vo_ zwb%S8qoaZqY0-$ZI+ViIA_1~~rAH7K_+yFS{0rT@eQtTAdz#8E5VpwnW!zJ_^{Utv zlW5Iar3V5t&H4D6A=>?mq;G92;1cg9a2sf;gY9pJDVKn$DYdQlvfXq}zz8#LyPGq@ z+`YUMD;^-6w&r-82JL7mA8&M~Pj@aK!m{0+^v<|t%APYf7`}jGEhdYLqsHW-Le9TL z_hZZ1gbrz7$f9^fAzVIP30^KIz!!#+DRLL+qMszvI_BpOSmjtl$hh;&UeM{ER@INV zcI}VbiVTPoN|iSna@=7XkP&-4#06C};8ajbxJ4Gcq8(vWv4*&X8bM^T$mBk75Q92j z1v&%a;OSKc8EIrodmIiw$lOES2hzGDcjjB`kEDfJe{r}yE6`eZL zEB`9u>Cl0IsQ+t}`-cx}{6jqcANucqIB>Qmga_&<+80E2Q|VHHQ$YlAt{6`Qu`HA3 z03s0-sSlwbvgi&_R8s={6<~M^pGvBNjKOa>tWenzS8s zR>L7R5aZ=mSU{f?ib4Grx$AeFvtO5N|D>9#)ChH#Fny2maHWHOf2G=#<9Myot#+4u zWVa6d^Vseq_0=#AYS(-m$Lp;*8nC_6jXIjEM`omUmtH@QDs3|G)i4j*#_?#UYVZvJ z?YjT-?!4Q{BNun;dKBWLEw2C-VeAz`%?A>p;)PL}TAZn5j~HK>v1W&anteARlE+~+ zj>c(F;?qO3pXBb|#OZdQnm<4xWmn~;DR5SDMxt0UK_F^&eD|KZ=O;tO3vy4@4h^;2 zUL~-z`-P1aOe?|ZC1BgVsL)2^J-&vIFI%q@40w0{jjEfeVl)i9(~bt2z#2Vm)p`V_ z1;6$Ae7=YXk#=Qkd24Y23t&GvRxaOoad~NbJ+6pxqzJ>FY#Td7@`N5xp!n(c!=RE& z&<<@^a$_Ys8jqz4|5Nk#FY$~|FPC0`*a5HH!|Gssa9=~66&xG9)|=pOOJ2KE5|YrR zw!w6K2aC=J$t?L-;}5hn6mHd%hC;p8P|Dgh6D>hGnXPgi;6r+eA=?f72y9(Cf_ho{ zH6#)uD&R=73^$$NE;5piWX2bzR67fQ)`b=85o0eOLGI4c-Tb@-KNi2pz=Ke@SDcPn za$AxXib84`!Sf;Z3B@TSo`Dz7GM5Kf(@PR>Ghzi=BBxK8wRp>YQoXm+iL>H*Jo9M3 z6w&E?BC8AFTFT&Tv8zf+m9<&S&%dIaZ)Aoqkak_$r-2{$d~0g2oLETx9Y`eOAf14QXEQw3tJne;fdzl@wV#TFXSLXM2428F-Q}t+n2g%vPRMUzYPvzQ9f# zu(liiJem9P*?0%V@RwA7F53r~|I!Ty)<*AsMX3J{_4&}{6pT%Tpw>)^|DJ)>gpS~1rNEh z0$D?uO8mG?H;2BwM5a*26^7YO$XjUm40XmBsb63MoR;bJh63J;OngS5sSI+o2HA;W zdZV#8pDpC9Oez&L8loZO)MClRz!_!WD&QRtQxnazhT%Vj6Wl4G11nUk8*vSeVab@N#oJ}`KyJv+8Mo@T1-pqZ1t|?cnaVOd;1(h9 z!$DrN=jcGsVYE-0-n?oCJ^4x)F}E;UaD-LZUIzcD?W^ficqJWM%QLy6QikrM1aKZC zi{?;oKwq^Vsr|&`i{jIphA8S6G4)$KGvpULjH%9u(Dq247;R#l&I0{IhcC|oBF*Al zvLo7Xte=C{aIt*otJD}BUq)|_pdR>{zBMT< z(^1RpZv*l*m*OV^8>9&asGBo8h*_4q*)-eCv*|Pq=XNGrZE)^(SF7^{QE_~4VDB(o zVcPA_!G+2CAtLbl+`=Q~9iW`4ZRLku!uB?;tWqVjB0lEOf}2RD7dJ=BExy=<9wkb- z9&7{XFA%n#JsHYN8t5d~=T~5DcW4$B%3M+nNvC2`0!#@sckqlzo5;hhGi(D9=*A4` z5ynobawSPRtWn&CDLEs3Xf`(8^zDP=NdF~F^s&={l7(aw&EG}KWpMjtmz7j_VLO;@ zM2NVLDxZ@GIv7*gzl1 zjq78tv*8#WSY`}Su0&C;2F$Ze(q>F(@Wm^Gw!)(j;dk9Ad{STaxn)IV9FZhm*n+U} zi;4y*3v%A`_c7a__DJ8D1b@dl0Std3F||4Wtvi)fCcBRh!X9$1x!_VzUh>*S5s!oq z;qd{J_r79EL2wIeiGAqFstWtkfIJpjVh%zFo*=55B9Zq~y0=^iqHWfQl@O!Ak;(o*m!pZqe9 z%U2oDOhR)BvW8&F70L;2TpkzIutIvNQaTjjs5V#8mV4!NQ}zN=i`i@WI1z0eN-iCS z;vL-Wxc^Vc_qK<5RPh(}*8dLT{~GzE{w2o$2kMFaEl&q zP{V=>&3kW7tWaK-Exy{~`v4J0U#OZBk{a9{&)&QG18L@6=bsZ1zC_d{{pKZ-Ey>I> z;8H0t4bwyQqgu4hmO`3|4K{R*5>qnQ&gOfdy?z`XD%e5+pTDzUt3`k^u~SaL&XMe= z9*h#kT(*Q9jO#w2Hd|Mr-%DV8i_1{J1MU~XJ3!WUplhXDYBpJH><0OU`**nIvPIof z|N8@I=wA)sf45SAvx||f?Z5uB$kz1qL3Ky_{%RPdP5iN-D2!p5scq}buuC00C@jom zhfGKm3|f?Z0iQ|K$Z~!`8{nmAS1r+fp6r#YDOS8V*;K&Gs7Lc&f^$RC66O|)28oh`NHy&vq zJh+hAw8+ybTB0@VhWN^0iiTnLsCWbS_y`^gs!LX!Lw{yE``!UVzrV24tP8o;I6-65 z1MUiHw^{bB15tmrVT*7-#sj6cs~z`wk52YQJ*TG{SE;KTm#Hf#a~|<(|ImHH17nNM z`Ub{+J3dMD!)mzC8b(2tZtokKW5pAwHa?NFiso~# z1*iaNh4lQ4TS)|@G)H4dZV@l*Vd;Rw;-;odDhW2&lJ%m@jz+Panv7LQm~2Js6rOW3 z0_&2cW^b^MYW3)@o;neZ<{B4c#m48dAl$GCc=$>ErDe|?y@z`$uq3xd(%aAsX)D%l z>y*SQ%My`yDP*zof|3@_w#cjaW_YW4BdA;#Glg1RQcJGY*CJ9`H{@|D+*e~*457kd z73p<%fB^PV!Ybw@)Dr%(ZJbX}xmCStCYv#K3O32ej{$9IzM^I{6FJ8!(=azt7RWf4 z7ib0UOPqN40X!wOnFOoddd8`!_IN~9O)#HRTyjfc#&MCZ zZAMzOVB=;qwt8gV?{Y2?b=iSZG~RF~uyx18K)IDFLl})G1v@$(s{O4@RJ%OTJyF+Cpcx4jmy|F3euCnMK!P2WTDu5j z{{gD$=M*pH!GGzL%P)V2*ROm>!$Y=z|D`!_yY6e7SU$~a5q8?hZGgaYqaiLnkK%?0 zs#oI%;zOxF@g*@(V4p!$7dS1rOr6GVs6uYCTt2h)eB4?(&w8{#o)s#%gN@BBosRUe z)@P@8_Zm89pr~)b>e{tbPC~&_MR--iB{=)y;INU5#)@Gix-YpgP<-c2Ms{9zuCX|3 z!p(?VaXww&(w&uBHzoT%!A2=3HAP>SDxcljrego7rY|%hxy3XlODWffO_%g|l+7Y_ zqV(xbu)s4lV=l7M;f>vJl{`6qBm>#ZeMA}kXb97Z)?R97EkoI?x6Lp0yu1Z>PS?2{ z0QQ(8D)|lc9CO3B~e(pQM&5(1y&y=e>C^X$`)_&XuaI!IgDTVqt31wX#n+@!a_A0ZQkA zCJ2@M_4Gb5MfCrm5UPggeyh)8 zO9?`B0J#rkoCx(R0I!ko_2?iO@|oRf1;3r+i)w-2&j?=;NVIdPFsB)`|IC0zk6r9c zRrkfxWsiJ(#8QndNJj@{@WP2Ackr|r1VxV{7S&rSU(^)-M8gV>@UzOLXu9K<{6e{T zXJ6b92r$!|lwjhmgqkdswY&}c)KW4A)-ac%sU;2^fvq7gfUW4Bw$b!i@duy1CAxSn z(pyh$^Z=&O-q<{bZUP+$U}=*#M9uVc>CQVgDs4swy5&8RAHZ~$)hrTF4W zPsSa~qYv_0mJnF89RnnJTH`3}w4?~epFl=D(35$ zWa07ON$`OMBOHgCmfO(9RFc<)?$x)N}Jd2A(<*Ll7+4jrRt9w zwGxExUXd9VB#I|DwfxvJ;HZ8Q{37^wDhaZ%O!oO(HpcqfLH%#a#!~;Jl7F5>EX_=8 z{()l2NqPz>La3qJR;_v+wlK>GsHl;uRA8%j`A|yH@k5r%55S9{*Cp%uw6t`qc1!*T za2OeqtQj7sAp#Q~=5Fs&aCR9v>5V+s&RdNvo&H~6FJOjvaj--2sYYBvMq;55%z8^o z|BJDA4vzfow#DO#ZQHh;Oq_{r+qP{R9ox2TOgwQiv7Ow!zjN+A@BN;0tA2lUb#+zO z(^b89eV)D7UVE+h{mcNc6&GtpOqDn_?VAQ)Vob$hlFwW%xh>D#wml{t&Ofmm_d_+; zKDxzdr}`n2Rw`DtyIjrG)eD0vut$}dJAZ0AohZ+ZQdWXn_Z@dI_y=7t3q8x#pDI-K z2VVc&EGq445Rq-j0=U=Zx`oBaBjsefY;%)Co>J3v4l8V(T8H?49_@;K6q#r~Wwppc z4XW0(4k}cP=5ex>-Xt3oATZ~bBWKv)aw|I|Lx=9C1s~&b77idz({&q3T(Y(KbWO?+ zmcZ6?WeUsGk6>km*~234YC+2e6Zxdl~<_g2J|IE`GH%n<%PRv-50; zH{tnVts*S5*_RxFT9eM0z-pksIb^drUq4>QSww=u;UFCv2AhOuXE*V4z?MM`|ABOC4P;OfhS(M{1|c%QZ=!%rQTDFx`+}?Kdx$&FU?Y<$x;j7z=(;Lyz+?EE>ov!8vvMtSzG!nMie zsBa9t8as#2nH}n8xzN%W%U$#MHNXmDUVr@GX{?(=yI=4vks|V)!-W5jHsU|h_&+kY zS_8^kd3jlYqOoiI`ZqBVY!(UfnAGny!FowZWY_@YR0z!nG7m{{)4OS$q&YDyw6vC$ zm4!$h>*|!2LbMbxS+VM6&DIrL*X4DeMO!@#EzMVfr)e4Tagn~AQHIU8?e61TuhcKD zr!F4(kEebk(Wdk-?4oXM(rJwanS>Jc%<>R(siF+>+5*CqJLecP_we33iTFTXr6W^G z7M?LPC-qFHK;E!fxCP)`8rkxZyFk{EV;G-|kwf4b$c1k0atD?85+|4V%YATWMG|?K zLyLrws36p%Qz6{}>7b>)$pe>mR+=IWuGrX{3ZPZXF3plvuv5Huax86}KX*lbPVr}L z{C#lDjdDeHr~?l|)Vp_}T|%$qF&q#U;ClHEPVuS+Jg~NjC1RP=17=aQKGOcJ6B3mp z8?4*-fAD~}sX*=E6!}^u8)+m2j<&FSW%pYr_d|p_{28DZ#Cz0@NF=gC-o$MY?8Ca8 zr5Y8DSR^*urS~rhpX^05r30Ik#2>*dIOGxRm0#0YX@YQ%Mg5b6dXlS!4{7O_kdaW8PFSdj1=ryI-=5$fiieGK{LZ+SX(1b=MNL!q#lN zv98?fqqTUH8r8C7v(cx#BQ5P9W>- zmW93;eH6T`vuJ~rqtIBg%A6>q>gnWb3X!r0wh_q;211+Om&?nvYzL1hhtjB zK_7G3!n7PL>d!kj){HQE zE8(%J%dWLh1_k%gVXTZt zEdT09XSKAx27Ncaq|(vzL3gm83q>6CAw<$fTnMU05*xAe&rDfCiu`u^1)CD<>sx0i z*hr^N_TeN89G(nunZoLBf^81#pmM}>JgD@Nn1l*lN#a=B=9pN%tmvYFjFIoKe_(GF z-26x{(KXdfsQL7Uv6UtDuYwV`;8V3w>oT_I<`Ccz3QqK9tYT5ZQzbop{=I=!pMOCb zCU68`n?^DT%^&m>A%+-~#lvF!7`L7a{z<3JqIlk1$<||_J}vW1U9Y&eX<}l8##6i( zZcTT@2`9(Mecptm@{3A_Y(X`w9K0EwtPq~O!16bq{7c0f7#(3wn-^)h zxV&M~iiF!{-6A@>o;$RzQ5A50kxXYj!tcgme=Qjrbje~;5X2xryU;vH|6bE(8z^<7 zQ>BG7_c*JG8~K7Oe68i#0~C$v?-t@~@r3t2inUnLT(c=URpA9kA8uq9PKU(Ps(LVH zqgcqW>Gm?6oV#AldDPKVRcEyQIdTT`Qa1j~vS{<;SwyTdr&3*t?J)y=M7q*CzucZ&B0M=joT zBbj@*SY;o2^_h*>R0e({!QHF0=)0hOj^B^d*m>SnRrwq>MolNSgl^~r8GR#mDWGYEIJA8B<|{{j?-7p zVnV$zancW3&JVDtVpIlI|5djKq0(w$KxEFzEiiL=h5Jw~4Le23@s(mYyXWL9SX6Ot zmb)sZaly_P%BeX_9 zw&{yBef8tFm+%=--m*J|o~+Xg3N+$IH)t)=fqD+|fEk4AAZ&!wcN5=mi~Vvo^i`}> z#_3ahR}Ju)(Px7kev#JGcSwPXJ2id9%Qd2A#Uc@t8~egZ8;iC{e! z%=CGJOD1}j!HW_sgbi_8suYnn4#Ou}%9u)dXd3huFIb!ytlX>Denx@pCS-Nj$`VO&j@(z!kKSP0hE4;YIP#w9ta=3DO$7f*x zc9M4&NK%IrVmZAe=r@skWD`AEWH=g+r|*13Ss$+{c_R!b?>?UaGXlw*8qDmY#xlR= z<0XFbs2t?8i^G~m?b|!Hal^ZjRjt<@a? z%({Gn14b4-a|#uY^=@iiKH+k?~~wTj5K1A&hU z2^9-HTC)7zpoWK|$JXaBL6C z#qSNYtY>65T@Zs&-0cHeu|RX(Pxz6vTITdzJdYippF zC-EB+n4}#lM7`2Ry~SO>FxhKboIAF#Z{1wqxaCb{#yEFhLuX;Rx(Lz%T`Xo1+a2M}7D+@wol2)OJs$TwtRNJ={( zD@#zTUEE}#Fz#&(EoD|SV#bayvr&E0vzmb%H?o~46|FAcx?r4$N z&67W3mdip-T1RIxwSm_&(%U|+WvtGBj*}t69XVd&ebn>KOuL(7Y8cV?THd-(+9>G7*Nt%T zcH;`p={`SOjaf7hNd(=37Lz3-51;58JffzIPgGs_7xIOsB5p2t&@v1mKS$2D$*GQ6 zM(IR*j4{nri7NMK9xlDy-hJW6sW|ZiDRaFiayj%;(%51DN!ZCCCXz+0Vm#};70nOx zJ#yA0P3p^1DED;jGdPbQWo0WATN=&2(QybbVdhd=Vq*liDk`c7iZ?*AKEYC#SY&2g z&Q(Ci)MJ{mEat$ZdSwTjf6h~roanYh2?9j$CF@4hjj_f35kTKuGHvIs9}Re@iKMxS-OI*`0S z6s)fOtz}O$T?PLFVSeOjSO26$@u`e<>k(OSP!&YstH3ANh>)mzmKGNOwOawq-MPXe zy4xbeUAl6tamnx))-`Gi2uV5>9n(73yS)Ukma4*7fI8PaEwa)dWHs6QA6>$}7?(L8 ztN8M}?{Tf!Zu22J5?2@95&rQ|F7=FK-hihT-vDp!5JCcWrVogEnp;CHenAZ)+E+K5 z$Cffk5sNwD_?4+ymgcHR(5xgt20Z8M`2*;MzOM#>yhk{r3x=EyM226wb&!+j`W<%* zSc&|`8!>dn9D@!pYow~(DsY_naSx7(Z4i>cu#hA5=;IuI88}7f%)bRkuY2B;+9Uep zpXcvFWkJ!mQai63BgNXG26$5kyhZ2&*3Q_tk)Ii4M>@p~_~q_cE!|^A;_MHB;7s#9 zKzMzK{lIxotjc};k67^Xsl-gS!^*m*m6kn|sbdun`O?dUkJ{0cmI0-_2y=lTAfn*Y zKg*A-2sJq)CCJgY0LF-VQvl&6HIXZyxo2#!O&6fOhbHXC?%1cMc6y^*dOS{f$=137Ds1m01qs`>iUQ49JijsaQ( zksqV9@&?il$|4Ua%4!O15>Zy&%gBY&wgqB>XA3!EldQ%1CRSM(pp#k~-pkcCg4LAT zXE=puHbgsw)!xtc@P4r~Z}nTF=D2~j(6D%gTBw$(`Fc=OOQ0kiW$_RDd=hcO0t97h zb86S5r=>(@VGy1&#S$Kg_H@7G^;8Ue)X5Y+IWUi`o;mpvoV)`fcVk4FpcT|;EG!;? zHG^zrVVZOm>1KFaHlaogcWj(v!S)O(Aa|Vo?S|P z5|6b{qkH(USa*Z7-y_Uvty_Z1|B{rTS^qmEMLEYUSk03_Fg&!O3BMo{b^*`3SHvl0 zhnLTe^_vVIdcSHe)SQE}r~2dq)VZJ!aSKR?RS<(9lzkYo&dQ?mubnWmgMM37Nudwo z3Vz@R{=m2gENUE3V4NbIzAA$H1z0pagz94-PTJyX{b$yndsdKptmlKQKaaHj@3=ED zc7L?p@%ui|RegVYutK$64q4pe9+5sv34QUpo)u{1ci?)_7gXQd{PL>b0l(LI#rJmN zGuO+%GO`xneFOOr4EU(Wg}_%bhzUf;d@TU+V*2#}!2OLwg~%D;1FAu=Un>OgjPb3S z7l(riiCwgghC=Lm5hWGf5NdGp#01xQ59`HJcLXbUR3&n%P(+W2q$h2Qd z*6+-QXJ*&Kvk9ht0f0*rO_|FMBALen{j7T1l%=Q>gf#kma zQlg#I9+HB+z*5BMxdesMND`_W;q5|FaEURFk|~&{@qY32N$G$2B=&Po{=!)x5b!#n zxLzblkq{yj05#O7(GRuT39(06FJlalyv<#K4m}+vs>9@q-&31@1(QBv82{}Zkns~K ze{eHC_RDX0#^A*JQTwF`a=IkE6Ze@j#-8Q`tTT?k9`^ZhA~3eCZJ-Jr{~7Cx;H4A3 zcZ+Zj{mzFZbVvQ6U~n>$U2ZotGsERZ@}VKrgGh0xM;Jzt29%TX6_&CWzg+YYMozrM z`nutuS)_0dCM8UVaKRj804J4i%z2BA_8A4OJRQ$N(P9Mfn-gF;4#q788C@9XR0O3< zsoS4wIoyt046d+LnSCJOy@B@Uz*#GGd#+Ln1ek5Dv>(ZtD@tgZlPnZZJGBLr^JK+!$$?A_fA3LOrkoDRH&l7 zcMcD$Hsjko3`-{bn)jPL6E9Ds{WskMrivsUu5apD z?grQO@W7i5+%X&E&p|RBaEZ(sGLR@~(y^BI@lDMot^Ll?!`90KT!JXUhYS`ZgX3jnu@Ja^seA*M5R@f`=`ynQV4rc$uT1mvE?@tz)TN<=&H1%Z?5yjxcpO+6y_R z6EPuPKM5uxKpmZfT(WKjRRNHs@ib)F5WAP7QCADvmCSD#hPz$V10wiD&{NXyEwx5S z6NE`3z!IS^$s7m}PCwQutVQ#~w+V z=+~->DI*bR2j0^@dMr9`p>q^Ny~NrAVxrJtX2DUveic5vM%#N*XO|?YAWwNI$Q)_) zvE|L(L1jP@F%gOGtnlXtIv2&1i8q<)Xfz8O3G^Ea~e*HJsQgBxWL(yuLY+jqUK zRE~`-zklrGog(X}$9@ZVUw!8*=l`6mzYLtsg`AvBYz(cxmAhr^j0~(rzXdiOEeu_p zE$sf2(w(BPAvO5DlaN&uQ$4@p-b?fRs}d7&2UQ4Fh?1Hzu*YVjcndqJLw0#q@fR4u zJCJ}>_7-|QbvOfylj+e^_L`5Ep9gqd>XI3-O?Wp z-gt*P29f$Tx(mtS`0d05nHH=gm~Po_^OxxUwV294BDKT>PHVlC5bndncxGR!n(OOm znsNt@Q&N{TLrmsoKFw0&_M9$&+C24`sIXGWgQaz=kY;S{?w`z^Q0JXXBKFLj0w0U6P*+jPKyZHX9F#b0D1$&(- zrm8PJd?+SrVf^JlfTM^qGDK&-p2Kdfg?f>^%>1n8bu&byH(huaocL>l@f%c*QkX2i znl}VZ4R1en4S&Bcqw?$=Zi7ohqB$Jw9x`aM#>pHc0x z0$!q7iFu zZ`tryM70qBI6JWWTF9EjgG@>6SRzsd}3h+4D8d~@CR07P$LJ}MFsYi-*O%XVvD@yT|rJ+Mk zDllJ7$n0V&A!0flbOf)HE6P_afPWZmbhpliqJuw=-h+r;WGk|ntkWN(8tKlYpq5Ow z(@%s>IN8nHRaYb*^d;M(D$zGCv5C|uqmsDjwy4g=Lz>*OhO3z=)VD}C<65;`89Ye} zSCxrv#ILzIpEx1KdLPlM&%Cctf@FqTKvNPXC&`*H9=l=D3r!GLM?UV zOxa(8ZsB`&+76S-_xuj?G#wXBfDY@Z_tMpXJS7^mp z@YX&u0jYw2A+Z+bD#6sgVK5ZgdPSJV3>{K^4~%HV?rn~4D)*2H!67Y>0aOmzup`{D zzDp3c9yEbGCY$U<8biJ_gB*`jluz1ShUd!QUIQJ$*1;MXCMApJ^m*Fiv88RZ zFopLViw}{$Tyhh_{MLGIE2~sZ)t0VvoW%=8qKZ>h=adTe3QM$&$PO2lfqH@brt!9j ziePM8$!CgE9iz6B<6_wyTQj?qYa;eC^{x_0wuwV~W+^fZmFco-o%wsKSnjXFEx02V zF5C2t)T6Gw$Kf^_c;Ei3G~uC8SM-xyycmXyC2hAVi-IfXqhu$$-C=*|X?R0~hu z8`J6TdgflslhrmDZq1f?GXF7*ALeMmOEpRDg(s*H`4>_NAr`2uqF;k;JQ+8>A|_6ZNsNLECC%NNEb1Y1dP zbIEmNpK)#XagtL4R6BC{C5T(+=yA-(Z|Ap}U-AfZM#gwVpus3(gPn}Q$CExObJ5AC z)ff9Yk?wZ}dZ-^)?cbb9Fw#EjqQ8jxF4G3=L?Ra zg_)0QDMV1y^A^>HRI$x?Op@t;oj&H@1xt4SZ9(kifQ zb59B*`M99Td7@aZ3UWvj1rD0sE)d=BsBuW*KwkCds7ay(7*01_+L}b~7)VHI>F_!{ zyxg-&nCO?v#KOUec0{OOKy+sjWA;8rTE|Lv6I9H?CI?H(mUm8VXGwU$49LGpz&{nQp2}dinE1@lZ1iox6{ghN&v^GZv9J${7WaXj)<0S4g_uiJ&JCZ zr8-hsu`U%N;+9N^@&Q0^kVPB3)wY(rr}p7{p0qFHb3NUUHJb672+wRZs`gd1UjKPX z4o6zljKKA+Kkj?H>Ew63o%QjyBk&1!P22;MkD>sM0=z_s-G{mTixJCT9@_|*(p^bz zJ8?ZZ&;pzV+7#6Mn`_U-)k8Pjg?a;|Oe^us^PoPY$Va~yi8|?+&=y$f+lABT<*pZr zP}D{~Pq1Qyni+@|aP;ixO~mbEW9#c0OU#YbDZIaw=_&$K%Ep2f%hO^&P67hApZe`x zv8b`Mz@?M_7-)b!lkQKk)JXXUuT|B8kJlvqRmRpxtQDgvrHMXC1B$M@Y%Me!BSx3P z#2Eawl$HleZhhTS6Txm>lN_+I`>eV$&v9fOg)%zVn3O5mI*lAl>QcHuW6!Kixmq`X zBCZ*Ck6OYtDiK!N47>jxI&O2a9x7M|i^IagRr-fmrmikEQGgw%J7bO|)*$2FW95O4 zeBs>KR)izRG1gRVL;F*sr8A}aRHO0gc$$j&ds8CIO1=Gwq1%_~E)CWNn9pCtBE}+`Jelk4{>S)M)`Ll=!~gnn1yq^EX(+y*ik@3Ou0qU`IgYi3*doM+5&dU!cho$pZ zn%lhKeZkS72P?Cf68<#kll_6OAO26bIbueZx**j6o;I0cS^XiL`y+>{cD}gd%lux} z)3N>MaE24WBZ}s0ApfdM;5J_Ny}rfUyxfkC``Awo2#sgLnGPewK};dORuT?@I6(5~ z?kE)Qh$L&fwJXzK){iYx!l5$Tt|^D~MkGZPA}(o6f7w~O2G6Vvzdo*a;iXzk$B66$ zwF#;wM7A+(;uFG4+UAY(2`*3XXx|V$K8AYu#ECJYSl@S=uZW$ksfC$~qrrbQj4??z-)uz0QL}>k^?fPnJTPw% zGz)~?B4}u0CzOf@l^um}HZzbaIwPmb<)< zi_3@E9lc)Qe2_`*Z^HH;1CXOceL=CHpHS{HySy3T%<^NrWQ}G0i4e1xm_K3(+~oi$ zoHl9wzb?Z4j#90DtURtjtgvi7uw8DzHYmtPb;?%8vb9n@bszT=1qr)V_>R%s!92_` zfnHQPANx z<#hIjIMm#*(v*!OXtF+w8kLu`o?VZ5k7{`vw{Yc^qYclpUGIM_PBN1+c{#Vxv&E*@ zxg=W2W~JuV{IuRYw3>LSI1)a!thID@R=bU+cU@DbR^_SXY`MC7HOsCN z!dO4OKV7(E_Z8T#8MA1H`99?Z!r0)qKW_#|29X3#Jb+5+>qUidbeP1NJ@)(qi2S-X zao|f0_tl(O+$R|Qwd$H{_ig|~I1fbp_$NkI!0E;Y z6JrnU{1Ra6^on{9gUUB0mwzP3S%B#h0fjo>JvV~#+X0P~JV=IG=yHG$O+p5O3NUgG zEQ}z6BTp^Fie)Sg<){Z&I8NwPR(=mO4joTLHkJ>|Tnk23E(Bo`FSbPc05lF2-+)X? z6vV3*m~IBHTy*^E!<0nA(tCOJW2G4DsH7)BxLV8kICn5lu6@U*R`w)o9;Ro$i8=Q^V%uH8n3q=+Yf;SFRZu z!+F&PKcH#8cG?aSK_Tl@K9P#8o+jry@gdexz&d(Q=47<7nw@e@FFfIRNL9^)1i@;A z28+$Z#rjv-wj#heI|<&J_DiJ*s}xd-f!{J8jfqOHE`TiHHZVIA8CjkNQ_u;Ery^^t zl1I75&u^`1_q)crO+JT4rx|z2ToSC>)Or@-D zy3S>jW*sNIZR-EBsfyaJ+Jq4BQE4?SePtD2+jY8*%FsSLZ9MY>+wk?}}}AFAw)vr{ml)8LUG-y9>^t!{~|sgpxYc0Gnkg`&~R z-pilJZjr@y5$>B=VMdZ73svct%##v%wdX~9fz6i3Q-zOKJ9wso+h?VME7}SjL=!NUG{J?M&i!>ma`eoEa@IX`5G>B1(7;%}M*%-# zfhJ(W{y;>MRz!Ic8=S}VaBKqh;~7KdnGEHxcL$kA-6E~=!hrN*zw9N+_=odt<$_H_8dbo;0=42wcAETPCVGUr~v(`Uai zb{=D!Qc!dOEU6v)2eHSZq%5iqK?B(JlCq%T6av$Cb4Rko6onlG&?CqaX7Y_C_cOC3 zYZ;_oI(}=>_07}Oep&Ws7x7-R)cc8zfe!SYxJYP``pi$FDS)4Fvw5HH=FiU6xfVqIM!hJ;Rx8c0cB7~aPtNH(Nmm5Vh{ibAoU#J6 zImRCr?(iyu_4W_6AWo3*vxTPUw@vPwy@E0`(>1Qi=%>5eSIrp^`` zK*Y?fK_6F1W>-7UsB)RPC4>>Ps9)f+^MqM}8AUm@tZ->j%&h1M8s*s!LX5&WxQcAh z8mciQej@RPm?660%>{_D+7er>%zX_{s|$Z+;G7_sfNfBgY(zLB4Ey}J9F>zX#K0f6 z?dVNIeEh?EIShmP6>M+d|0wMM85Sa4diw1hrg|ITJ}JDg@o8y>(rF9mXk5M z2@D|NA)-7>wD&wF;S_$KS=eE84`BGw3g0?6wGxu8ys4rwI?9U=*^VF22t3%mbGeOh z`!O-OpF7#Vceu~F`${bW0nYVU9ecmk31V{tF%iv&5hWofC>I~cqAt@u6|R+|HLMMX zVxuSlMFOK_EQ86#E8&KwxIr8S9tj_goWtLv4f@!&h8;Ov41{J~496vp9vX=(LK#j! zAwi*21RAV-LD>9Cw3bV_9X(X3)Kr0-UaB*7Y>t82EQ%!)(&(XuAYtTsYy-dz+w=$ir)VJpe!_$ z6SGpX^i(af3{o=VlFPC);|J8#(=_8#vdxDe|Cok+ANhYwbE*FO`Su2m1~w+&9<_9~ z-|tTU_ACGN`~CNW5WYYBn^B#SwZ(t4%3aPp z;o)|L6Rk569KGxFLUPx@!6OOa+5OjQLK5w&nAmwxkC5rZ|m&HT8G%GVZxB_@ME z>>{rnXUqyiJrT(8GMj_ap#yN_!9-lO5e8mR3cJiK3NE{_UM&=*vIU`YkiL$1%kf+1 z4=jk@7EEj`u(jy$HnzE33ZVW_J4bj}K;vT?T91YlO(|Y0FU4r+VdbmQ97%(J5 zkK*Bed8+C}FcZ@HIgdCMioV%A<*4pw_n}l*{Cr4}a(lq|injK#O?$tyvyE`S%(1`H z_wwRvk#13ElkZvij2MFGOj`fhy?nC^8`Zyo%yVcUAfEr8x&J#A{|moUBAV_^f$hpaUuyQeY3da^ zS9iRgf87YBwfe}>BO+T&Fl%rfpZh#+AM?Dq-k$Bq`vG6G_b4z%Kbd&v>qFjow*mBl z-OylnqOpLg}or7_VNwRg2za3VBK6FUfFX{|TD z`Wt0Vm2H$vdlRWYQJqDmM?JUbVqL*ZQY|5&sY*?!&%P8qhA~5+Af<{MaGo(dl&C5t zE%t!J0 zh6jqANt4ABdPxSTrVV}fLsRQal*)l&_*rFq(Ez}ClEH6LHv{J#v?+H-BZ2)Wy{K@9 z+ovXHq~DiDvm>O~r$LJo!cOuwL+Oa--6;UFE2q@g3N8Qkw5E>ytz^(&($!O47+i~$ zKM+tkAd-RbmP{s_rh+ugTD;lriL~`Xwkad#;_aM?nQ7L_muEFI}U_4$phjvYgleK~`Fo`;GiC07&Hq1F<%p;9Q;tv5b?*QnR%8DYJH3P>Svmv47Y>*LPZJy8_{9H`g6kQpyZU{oJ`m%&p~D=K#KpfoJ@ zn-3cqmHsdtN!f?~w+(t+I`*7GQA#EQC^lUA9(i6=i1PqSAc|ha91I%X&nXzjYaM{8$s&wEx@aVkQ6M{E2 zfzId#&r(XwUNtPcq4Ngze^+XaJA1EK-%&C9j>^9(secqe{}z>hR5CFNveMsVA)m#S zk)_%SidkY-XmMWlVnQ(mNJ>)ooszQ#vaK;!rPmGKXV7am^_F!Lz>;~{VrIO$;!#30XRhE1QqO_~#+Ux;B_D{Nk=grn z8Y0oR^4RqtcYM)7a%@B(XdbZCOqnX#fD{BQTeLvRHd(irHKq=4*jq34`6@VAQR8WG z^%)@5CXnD_T#f%@-l${>y$tfb>2LPmc{~5A82|16mH)R?&r#KKLs7xpN-D`=&Cm^R zvMA6#Ahr<3X>Q7|-qfTY)}32HkAz$_mibYV!I)u>bmjK`qwBe(>za^0Kt*HnFbSdO z1>+ryKCNxmm^)*$XfiDOF2|{-v3KKB?&!(S_Y=Ht@|ir^hLd978xuI&N{k>?(*f8H z=ClxVJK_%_z1TH0eUwm2J+2To7FK4o+n_na)&#VLn1m;!+CX+~WC+qg1?PA~KdOlC zW)C@pw75_xoe=w7i|r9KGIvQ$+3K?L{7TGHwrQM{dCp=Z*D}3kX7E-@sZnup!BImw z*T#a=+WcTwL78exTgBn|iNE3#EsOorO z*kt)gDzHiPt07fmisA2LWN?AymkdqTgr?=loT7z@d`wnlr6oN}@o|&JX!yPzC*Y8d zu6kWlTzE1)ckyBn+0Y^HMN+GA$wUO_LN6W>mxCo!0?oiQvT`z$jbSEu&{UHRU0E8# z%B^wOc@S!yhMT49Y)ww(Xta^8pmPCe@eI5C*ed96)AX9<>))nKx0(sci8gwob_1}4 z0DIL&vsJ1_s%<@y%U*-eX z5rN&(zef-5G~?@r79oZGW1d!WaTqQn0F6RIOa9tJ=0(kdd{d1{<*tHT#cCvl*i>YY zH+L7jq8xZNcTUBqj(S)ztTU!TM!RQ}In*n&Gn<>(60G7}4%WQL!o>hbJqNDSGwl#H z`4k+twp0cj%PsS+NKaxslAEu9!#U3xT1|_KB6`h=PI0SW`P9GTa7caD1}vKEglV8# zjKZR`pluCW19c2fM&ZG)c3T3Um;ir3y(tSCJ7Agl6|b524dy5El{^EQBG?E61H0XY z`bqg!;zhGhyMFl&(o=JWEJ8n~z)xI}A@C0d2hQGvw7nGv)?POU@(kS1m=%`|+^ika zXl8zjS?xqW$WlO?Ewa;vF~XbybHBor$f<%I&*t$F5fynwZlTGj|IjZtVfGa7l&tK} zW>I<69w(cZLu)QIVG|M2xzW@S+70NinQzk&Y0+3WT*cC)rx~04O-^<{JohU_&HL5XdUKW!uFy|i$FB|EMu0eUyW;gsf`XfIc!Z0V zeK&*hPL}f_cX=@iv>K%S5kL;cl_$v?n(Q9f_cChk8Lq$glT|=e+T*8O4H2n<=NGmn z+2*h+v;kBvF>}&0RDS>)B{1!_*XuE8A$Y=G8w^qGMtfudDBsD5>T5SB;Qo}fSkkiV ze^K^M(UthkwrD!&*tTsu>Dacdj_q`~V%r_twr$(Ct&_dKeeXE?fA&4&yASJWJ*}~- zel=@W)tusynfC_YqH4ll>4Eg`Xjs5F7Tj>tTLz<0N3)X<1px_d2yUY>X~y>>93*$) z5PuNMQLf9Bu?AAGO~a_|J2akO1M*@VYN^VxvP0F$2>;Zb9;d5Yfd8P%oFCCoZE$ z4#N$^J8rxYjUE_6{T%Y>MmWfHgScpuGv59#4u6fpTF%~KB^Ae`t1TD_^Ud#DhL+Dm zbY^VAM#MrAmFj{3-BpVSWph2b_Y6gCnCAombVa|1S@DU)2r9W<> zT5L8BB^er3zxKt1v(y&OYk!^aoQisqU zH(g@_o)D~BufUXcPt!Ydom)e|aW{XiMnes2z&rE?og>7|G+tp7&^;q?Qz5S5^yd$i z8lWr4g5nctBHtigX%0%XzIAB8U|T6&JsC4&^hZBw^*aIcuNO47de?|pGXJ4t}BB`L^d8tD`H`i zqrP8?#J@8T#;{^B!KO6J=@OWKhAerih(phML`(Rg7N1XWf1TN>=Z3Do{l_!d~DND&)O)D>ta20}@Lt77qSnVsA7>)uZAaT9bsB>u&aUQl+7GiY2|dAEg@%Al3i316y;&IhQL^8fw_nwS>f60M_-m+!5)S_6EPM7Y)(Nq^8gL7(3 zOiot`6Wy6%vw~a_H?1hLVzIT^i1;HedHgW9-P#)}Y6vF%C=P70X0Tk^z9Te@kPILI z_(gk!k+0%CG)%!WnBjjw*kAKs_lf#=5HXC00s-}oM-Q1aXYLj)(1d!_a7 z*Gg4Fe6F$*ujVjI|79Z5+Pr`us%zW@ln++2l+0hsngv<{mJ%?OfSo_3HJXOCys{Ug z00*YR-(fv<=&%Q!j%b-_ppA$JsTm^_L4x`$k{VpfLI(FMCap%LFAyq;#ns5bR7V+x zO!o;c5y~DyBPqdVQX)8G^G&jWkBy2|oWTw>)?5u}SAsI$RjT#)lTV&Rf8;>u*qXnb z8F%Xb=7#$m)83z%`E;49)t3fHInhtc#kx4wSLLms!*~Z$V?bTyUGiS&m>1P(952(H zuHdv=;o*{;5#X-uAyon`hP}d#U{uDlV?W?_5UjJvf%11hKwe&(&9_~{W)*y1nR5f_ z!N(R74nNK`y8>B!0Bt_Vr!;nc3W>~RiKtGSBkNlsR#-t^&;$W#)f9tTlZz>n*+Fjz z3zXZ;jf(sTM(oDzJt4FJS*8c&;PLTW(IQDFs_5QPy+7yhi1syPCarvqrHFcf&yTy)^O<1EBx;Ir`5W{TIM>{8w&PB>ro4;YD<5LF^TjTb0!zAP|QijA+1Vg>{Afv^% zmrkc4o6rvBI;Q8rj4*=AZacy*n8B{&G3VJc)so4$XUoie0)vr;qzPZVbb<#Fc=j+8CGBWe$n|3K& z_@%?{l|TzKSlUEO{U{{%Fz_pVDxs7i9H#bnbCw7@4DR=}r_qV!Zo~CvD4ZI*+j3kO zW6_=|S`)(*gM0Z;;}nj`73OigF4p6_NPZQ-Od~e$c_);;4-7sR>+2u$6m$Gf%T{aq zle>e3(*Rt(TPD}03n5)!Ca8Pu!V}m6v0o1;5<1h$*|7z|^(3$Y&;KHKTT}hV056wuF0Xo@mK-52~r=6^SI1NC%c~CC?n>yX6wPTgiWYVz!Sx^atLby9YNn1Rk{g?|pJaxD4|9cUf|V1_I*w zzxK)hRh9%zOl=*$?XUjly5z8?jPMy%vEN)f%T*|WO|bp5NWv@B(K3D6LMl!-6dQg0 zXNE&O>Oyf%K@`ngCvbGPR>HRg5!1IV$_}m@3dWB7x3t&KFyOJn9pxRXCAzFr&%37wXG;z^xaO$ekR=LJG ztIHpY8F5xBP{mtQidqNRoz= z@){+N3(VO5bD+VrmS^YjG@+JO{EOIW)9=F4v_$Ed8rZtHvjpiEp{r^c4F6Ic#ChlC zJX^DtSK+v(YdCW)^EFcs=XP7S>Y!4=xgmv>{S$~@h=xW-G4FF9?I@zYN$e5oF9g$# zb!eVU#J+NjLyX;yb)%SY)xJdvGhsnE*JEkuOVo^k5PyS=o#vq!KD46UTW_%R=Y&0G zFj6bV{`Y6)YoKgqnir2&+sl+i6foAn-**Zd1{_;Zb7Ki=u394C5J{l^H@XN`_6XTKY%X1AgQM6KycJ+= zYO=&t#5oSKB^pYhNdzPgH~aEGW2=ec1O#s-KG z71}LOg@4UEFtp3GY1PBemXpNs6UK-ax*)#$J^pC_me;Z$Je(OqLoh|ZrW*mAMBFn< zHttjwC&fkVfMnQeen8`Rvy^$pNRFVaiEN4Pih*Y3@jo!T0nsClN)pdrr9AYLcZxZ| zJ5Wlj+4q~($hbtuY zVQ7hl>4-+@6g1i`1a)rvtp-;b0>^`Dloy(#{z~ytgv=j4q^Kl}wD>K_Y!l~ zp(_&7sh`vfO(1*MO!B%<6E_bx1)&s+Ae`O)a|X=J9y~XDa@UB`m)`tSG4AUhoM=5& znWoHlA-(z@3n0=l{E)R-p8sB9XkV zZ#D8wietfHL?J5X0%&fGg@MH~(rNS2`GHS4xTo7L$>TPme+Is~!|79=^}QbPF>m%J zFMkGzSndiPO|E~hrhCeo@&Ea{M(ieIgRWMf)E}qeTxT8Q#g-!Lu*x$v8W^M^>?-g= zwMJ$dThI|~M06rG$Sv@C@tWR>_YgaG&!BAbkGggVQa#KdtDB)lMLNVLN|51C@F^y8 zCRvMB^{GO@j=cHfmy}_pCGbP%xb{pNN>? z?7tBz$1^zVaP|uaatYaIN+#xEN4jBzwZ|YI_)p(4CUAz1ZEbDk>J~Y|63SZaak~#0 zoYKruYsWHoOlC1(MhTnsdUOwQfz5p6-D0}4;DO$B;7#M{3lSE^jnTT;ns`>!G%i*F?@pR1JO{QTuD0U+~SlZxcc8~>IB{)@8p`P&+nDxNj`*gh|u?yrv$phpQcW)Us)bi`kT%qLj(fi{dWRZ%Es2!=3mI~UxiW0$-v3vUl?#g{p6eF zMEUAqo5-L0Ar(s{VlR9g=j7+lt!gP!UN2ICMokAZ5(Agd>})#gkA2w|5+<%-CuEP# zqgcM}u@3(QIC^Gx<2dbLj?cFSws_f3e%f4jeR?4M^M3cx1f+Qr6ydQ>n)kz1s##2w zk}UyQc+Z5G-d-1}{WzjkLXgS-2P7auWSJ%pSnD|Uivj5u!xk0 z_^-N9r9o;(rFDt~q1PvE#iJZ_f>J3gcP$)SOqhE~pD2|$=GvpL^d!r z6u=sp-CrMoF7;)}Zd7XO4XihC4ji?>V&(t^?@3Q&t9Mx=qex6C9d%{FE6dvU6%d94 zIE;hJ1J)cCqjv?F``7I*6bc#X)JW2b4f$L^>j{*$R`%5VHFi*+Q$2;nyieduE}qdS{L8y8F08yLs?w}{>8>$3236T-VMh@B zq-nujsb_1aUv_7g#)*rf9h%sFj*^mIcImRV*k~Vmw;%;YH(&ylYpy!&UjUVqqtfG` zox3esju?`unJJA_zKXRJP)rA3nXc$m^{S&-p|v|-0x9LHJm;XIww7C#R$?00l&Yyj z=e}gKUOpsImwW?N)+E(awoF@HyP^EhL+GlNB#k?R<2>95hz!h9sF@U20DHSB3~WMa zk90+858r@-+vWwkawJ)8ougd(i#1m3GLN{iSTylYz$brAsP%=&m$mQQrH$g%3-^VR zE%B`Vi&m8f3T~&myTEK28BDWCVzfWir1I?03;pX))|kY5ClO^+bae z*7E?g=3g7EiisYOrE+lA)2?Ln6q2*HLNpZEWMB|O-JI_oaHZB%CvYB(%=tU= zE*OY%QY58fW#RG5=gm0NR#iMB=EuNF@)%oZJ}nmm=tsJ?eGjia{e{yuU0l3{d^D@)kVDt=1PE)&tf_hHC%0MB znL|CRCPC}SeuVTdf>-QV70`0(EHizc21s^sU>y%hW0t!0&y<7}Wi-wGy>m%(-jsDj zP?mF|>p_K>liZ6ZP(w5(|9Ga%>tLgb$|doDDfkdW>Z z`)>V2XC?NJT26mL^@ zf+IKr27TfM!UbZ@?zRddC7#6ss1sw%CXJ4FWC+t3lHZupzM77m^=9 z&(a?-LxIq}*nvv)y?27lZ{j zifdl9hyJudyP2LpU$-kXctshbJDKS{WfulP5Dk~xU4Le4c#h^(YjJit4#R8_khheS z|8(>2ibaHES4+J|DBM7I#QF5u-*EdN{n=Kt@4Zt?@Tv{JZA{`4 zU#kYOv{#A&gGPwT+$Ud}AXlK3K7hYzo$(fBSFjrP{QQ zeaKg--L&jh$9N}`pu{Bs>?eDFPaWY4|9|foN%}i;3%;@4{dc+iw>m}{3rELqH21G! z`8@;w-zsJ1H(N3%|1B@#ioLOjib)j`EiJqPQVSbPSPVHCj6t5J&(NcWzBrzCiDt{4 zdlPAUKldz%6x5II1H_+jv)(xVL+a;P+-1hv_pM>gMRr%04@k;DTokASSKKhU1Qms| zrWh3a!b(J3n0>-tipg{a?UaKsP7?+|@A+1WPDiQIW1Sf@qDU~M_P65_s}7(gjTn0X zucyEm)o;f8UyshMy&>^SC3I|C6jR*R_GFwGranWZe*I>K+0k}pBuET&M~ z;Odo*ZcT?ZpduHyrf8E%IBFtv;JQ!N_m>!sV6ly$_1D{(&nO~w)G~Y`7sD3#hQk%^ zp}ucDF_$!6DAz*PM8yE(&~;%|=+h(Rn-=1Wykas_-@d&z#=S}rDf`4w(rVlcF&lF! z=1)M3YVz7orwk^BXhslJ8jR);sh^knJW(Qmm(QdSgIAIdlN4Te5KJisifjr?eB{FjAX1a0AB>d?qY4Wx>BZ8&}5K0fA+d{l8 z?^s&l8#j7pR&ijD?0b%;lL9l$P_mi2^*_OL+b}4kuLR$GAf85sOo02?Y#90}CCDiS zZ%rbCw>=H~CBO=C_JVV=xgDe%b4FaEFtuS7Q1##y686r%F6I)s-~2(}PWK|Z8M+Gu zl$y~5@#0Ka%$M<&Cv%L`a8X^@tY&T7<0|(6dNT=EsRe0%kp1Qyq!^43VAKYnr*A5~ zsI%lK1ewqO;0TpLrT9v}!@vJK{QoVa_+N4FYT#h?Y8rS1S&-G+m$FNMP?(8N`MZP zels(*?kK{{^g9DOzkuZXJ2;SrOQsp9T$hwRB1(phw1c7`!Q!by?Q#YsSM#I12RhU{$Q+{xj83axHcftEc$mNJ8_T7A-BQc*k(sZ+~NsO~xAA zxnbb%dam_fZlHvW7fKXrB~F&jS<4FD2FqY?VG?ix*r~MDXCE^WQ|W|WM;gsIA4lQP zJ2hAK@CF*3*VqPr2eeg6GzWFlICi8S>nO>5HvWzyZTE)hlkdC_>pBej*>o0EOHR|) z$?};&I4+_?wvL*g#PJ9)!bc#9BJu1(*RdNEn>#Oxta(VWeM40ola<0aOe2kSS~{^P zDJBd}0L-P#O-CzX*%+$#v;(x%<*SPgAje=F{Zh-@ucd2DA(yC|N_|ocs*|-!H%wEw z@Q!>siv2W;C^^j^59OAX03&}&D*W4EjCvfi(ygcL#~t8XGa#|NPO+*M@Y-)ctFA@I z-p7npT1#5zOLo>7q?aZpCZ=iecn3QYklP;gF0bq@>oyBq94f6C=;Csw3PkZ|5q=(c zfs`aw?II0e(h=|7o&T+hq&m$; zBrE09Twxd9BJ2P+QPN}*OdZ-JZV7%av@OM7v!!NL8R;%WFq*?{9T3{ct@2EKgc8h) zMxoM$SaF#p<`65BwIDfmXG6+OiK0e)`I=!A3E`+K@61f}0e z!2a*FOaDrOe>U`q%K!QN`&=&0C~)CaL3R4VY(NDt{Xz(Xpqru5=r#uQN1L$Je1*dkdqQ*=lofQaN%lO!<5z9ZlHgxt|`THd>2 zsWfU$9=p;yLyJyM^t zS2w9w?Bpto`@H^xJpZDKR1@~^30Il6oFGfk5%g6w*C+VM)+%R@gfIwNprOV5{F^M2 zO?n3DEzpT+EoSV-%OdvZvNF+pDd-ZVZ&d8 zKeIyrrfPN=EcFRCPEDCVflX#3-)Ik_HCkL(ejmY8vzcf-MTA{oHk!R2*36`O68$7J zf}zJC+bbQk--9Xm!u#lgLvx8TXx2J258E5^*IZ(FXMpq$2LUUvhWQPs((z1+2{Op% z?J}9k5^N=z;7ja~zi8a_-exIqWUBJwohe#4QJ`|FF*$C{lM18z^#hX6!5B8KAkLUX ziP=oti-gpV(BsLD{0(3*dw}4JxK23Y7M{BeFPucw!sHpY&l%Ws4pSm`+~V7;bZ%Dx zeI)MK=4vC&5#;2MT7fS?^ch9?2;%<8Jlu-IB&N~gg8t;6S-#C@!NU{`p7M8@2iGc& zg|JPg%@gCoCQ&s6JvDU&`X2S<57f(k8nJ1wvBu{8r?;q3_kpZZ${?|( z+^)UvR33sjSd)aT!UPkA;ylO6{aE3MQa{g%Mcf$1KONcjO@&g5zPHWtzM1rYC{_K> zgQNcs<{&X{OA=cEWw5JGqpr0O>x*Tfak2PE9?FuWtz^DDNI}rwAaT0(bdo-<+SJ6A z&}S%boGMWIS0L}=S>|-#kRX;e^sUsotry(MjE|3_9duvfc|nwF#NHuM-w7ZU!5ei8 z6Mkf>2)WunY2eU@C-Uj-A zG(z0Tz2YoBk>zCz_9-)4a>T46$(~kF+Y{#sA9MWH%5z#zNoz)sdXq7ZR_+`RZ%0(q zC7&GyS_|BGHNFl8Xa%@>iWh%Gr?=J5<(!OEjauj5jyrA-QXBjn0OAhJJ9+v=!LK`` z@g(`^*84Q4jcDL`OA&ZV60djgwG`|bcD*i50O}Q{9_noRg|~?dj%VtKOnyRs$Uzqg z191aWoR^rDX#@iSq0n z?9Sg$WSRPqSeI<}&n1T3!6%Wj@5iw5`*`Btni~G=&;J+4`7g#OQTa>u`{4ZZ(c@s$ zK0y;ySOGD-UTjREKbru{QaS>HjN<2)R%Nn-TZiQ(Twe4p@-saNa3~p{?^V9Nixz@a zykPv~<@lu6-Ng9i$Lrk(xi2Tri3q=RW`BJYOPC;S0Yly%77c727Yj-d1vF!Fuk{Xh z)lMbA69y7*5ufET>P*gXQrxsW+ zz)*MbHZv*eJPEXYE<6g6_M7N%#%mR{#awV3i^PafNv(zyI)&bH?F}2s8_rR(6%!V4SOWlup`TKAb@ee>!9JKPM=&8g#BeYRH9FpFybxBXQI2|g}FGJfJ+ zY-*2hB?o{TVL;Wt_ek;AP5PBqfDR4@Z->_182W z{P@Mc27j6jE*9xG{R$>6_;i=y{qf(c`5w9fa*`rEzX6t!KJ(p1H|>J1pC-2zqWENF zmm=Z5B4u{cY2XYl(PfrInB*~WGWik3@1oRhiMOS|D;acnf-Bs(QCm#wR;@Vf!hOPJ zgjhDCfDj$HcyVLJ=AaTbQ{@vIv14LWWF$=i-BDoC11}V;2V8A`S>_x)vIq44-VB-v z*w-d}$G+Ql?En8j!~ZkCpQ$|cA0|+rrY>tiCeWxkRGPoarxlGU2?7%k#F693RHT24 z-?JsiXlT2PTqZqNb&sSc>$d;O4V@|b6VKSWQb~bUaWn1Cf0+K%`Q&Wc<>mQ>*iEGB zbZ;aYOotBZ{vH3y<0A*L0QVM|#rf*LIsGx(O*-7)r@yyBIzJnBFSKBUSl1e|8lxU* zzFL+YDVVkIuzFWeJ8AbgN&w(4-7zbiaMn{5!JQXu)SELk*CNL+Fro|2v|YO)1l15t zs(0^&EB6DPMyaqvY>=KL>)tEpsn;N5Q#yJj<9}ImL((SqErWN3Q=;tBO~ExTCs9hB z2E$7eN#5wX4<3m^5pdjm#5o>s#eS_Q^P)tm$@SawTqF*1dj_i#)3};JslbLKHXl_N z)Fxzf>FN)EK&Rz&*|6&%Hs-^f{V|+_vL1S;-1K-l$5xiC@}%uDuwHYhmsV?YcOUlk zOYkG5v2+`+UWqpn0aaaqrD3lYdh0*!L`3FAsNKu=Q!vJu?Yc8n|CoYyDo_`r0mPoo z8>XCo$W4>l(==h?2~PoRR*kEe)&IH{1sM41mO#-36`02m#nTX{r*r`Q5rZ2-sE|nA zhnn5T#s#v`52T5|?GNS`%HgS2;R(*|^egNPDzzH_z^W)-Q98~$#YAe)cEZ%vge965AS_am#DK#pjPRr-!^za8>`kksCAUj(Xr*1NW5~e zpypt_eJpD&4_bl_y?G%>^L}=>xAaV>KR6;^aBytqpiHe%!j;&MzI_>Sx7O%F%D*8s zSN}cS^<{iiK)=Ji`FpO#^zY!_|D)qeRNAtgmH)m;qC|mq^j(|hL`7uBz+ULUj37gj zksdbnU+LSVo35riSX_4z{UX=%n&}7s0{WuZYoSfwAP`8aKN9P@%e=~1`~1ASL-z%# zw>DO&ixr}c9%4InGc*_y42bdEk)ZdG7-mTu0bD@_vGAr*NcFoMW;@r?@LUhRI zCUJgHb`O?M3!w)|CPu~ej%fddw20lod?Ufp8Dmt0PbnA0J%KE^2~AIcnKP()025V> zG>noSM3$5Btmc$GZoyP^v1@Poz0FD(6YSTH@aD0}BXva?LphAiSz9f&Y(aDAzBnUh z?d2m``~{z;{}kZJ>a^wYI?ry(V9hIoh;|EFc0*-#*`$T0DRQ1;WsqInG;YPS+I4{g zJGpKk%%Sdc5xBa$Q^_I~(F97eqDO7AN3EN0u)PNBAb+n+ zWBTxQx^;O9o0`=g+Zrt_{lP!sgWZHW?8bLYS$;1a@&7w9rD9|Ge;Gb?sEjFoF9-6v z#!2)t{DMHZ2@0W*fCx;62d#;jouz`R5Y(t{BT=$N4yr^^o$ON8d{PQ=!O zX17^CrdM~7D-;ZrC!||<+FEOxI_WI3CA<35va%4v>gc zEX-@h8esj=a4szW7x{0g$hwoWRQG$yK{@3mqd-jYiVofJE!Wok1* znV7Gm&Ssq#hFuvj1sRyHg(6PFA5U*Q8Rx>-blOs=lb`qa{zFy&n4xY;sd$fE+<3EI z##W$P9M{B3c3Si9gw^jlPU-JqD~Cye;wr=XkV7BSv#6}DrsXWFJ3eUNrc%7{=^sP> zrp)BWKA9<}^R9g!0q7yWlh;gr_TEOD|#BmGq<@IV;ueg+D2}cjpp+dPf&Q(36sFU&K8}hA85U61faW&{ zlB`9HUl-WWCG|<1XANN3JVAkRYvr5U4q6;!G*MTdSUt*Mi=z_y3B1A9j-@aK{lNvx zK%p23>M&=KTCgR!Ee8c?DAO2_R?B zkaqr6^BSP!8dHXxj%N1l+V$_%vzHjqvu7p@%Nl6;>y*S}M!B=pz=aqUV#`;h%M0rU zHfcog>kv3UZAEB*g7Er@t6CF8kHDmKTjO@rejA^ULqn!`LwrEwOVmHx^;g|5PHm#B zZ+jjWgjJ!043F+&#_;D*mz%Q60=L9Ove|$gU&~As5^uz@2-BfQ!bW)Khn}G+Wyjw- z19qI#oB(RSNydn0t~;tAmK!P-d{b-@@E5|cdgOS#!>%#Rj6ynkMvaW@37E>@hJP^8 z2zk8VXx|>#R^JCcWdBCy{0nPmYFOxN55#^-rlqobe0#L6)bi?E?SPymF*a5oDDeSd zO0gx?#KMoOd&G(2O@*W)HgX6y_aa6iMCl^~`{@UR`nMQE`>n_{_aY5nA}vqU8mt8H z`oa=g0SyiLd~BxAj2~l$zRSDHxvDs;I4>+M$W`HbJ|g&P+$!U7-PHX4RAcR0szJ*( ze-417=bO2q{492SWrqDK+L3#ChUHtz*@MP)e^%@>_&#Yk^1|tv@j4%3T)diEX zATx4K*hcO`sY$jk#jN5WD<=C3nvuVsRh||qDHnc~;Kf59zr0;c7VkVSUPD%NnnJC_ zl3F^#f_rDu8l}l8qcAz0FFa)EAt32IUy_JLIhU_J^l~FRH&6-ivSpG2PRqzDdMWft>Zc(c)#tb%wgmWN%>IOPm zZi-noqS!^Ftb81pRcQi`X#UhWK70hy4tGW1mz|+vI8c*h@ zfFGJtW3r>qV>1Z0r|L>7I3un^gcep$AAWfZHRvB|E*kktY$qQP_$YG60C@X~tTQjB3%@`uz!qxtxF+LE!+=nrS^07hn` zEgAp!h|r03h7B!$#OZW#ACD+M;-5J!W+{h|6I;5cNnE(Y863%1(oH}_FTW})8zYb$7czP zg~Szk1+_NTm6SJ0MS_|oSz%e(S~P-&SFp;!k?uFayytV$8HPwuyELSXOs^27XvK-D zOx-Dl!P|28DK6iX>p#Yb%3`A&CG0X2S43FjN%IB}q(!hC$fG}yl1y9W&W&I@KTg6@ zK^kpH8=yFuP+vI^+59|3%Zqnb5lTDAykf z9S#X`3N(X^SpdMyWQGOQRjhiwlj!0W-yD<3aEj^&X%=?`6lCy~?`&WSWt z?U~EKFcCG_RJ(Qp7j=$I%H8t)Z@6VjA#>1f@EYiS8MRHZphp zMA_5`znM=pzUpBPO)pXGYpQ6gkine{6u_o!P@Q+NKJ}k!_X7u|qfpAyIJb$_#3@wJ z<1SE2Edkfk9C!0t%}8Yio09^F`YGzpaJHGk*-ffsn85@)%4@`;Fv^8q(-Wk7r=Q8p zT&hD`5(f?M{gfzGbbwh8(}G#|#fDuk7v1W)5H9wkorE0ZZjL0Q1=NRGY>zwgfm81DdoaVwNH;or{{eSyybt)m<=zXoA^RALYG-2t zouH|L*BLvmm9cdMmn+KGopyR@4*=&0&4g|FLoreZOhRmh=)R0bg~ zT2(8V_q7~42-zvb)+y959OAv!V$u(O3)%Es0M@CRFmG{5sovIq4%8Ahjk#*5w{+)+ zMWQoJI_r$HxL5km1#6(e@{lK3Udc~n0@g`g$s?VrnQJ$!oPnb?IHh-1qA`Rz$)Ai< z6w$-MJW-gKNvOhL+XMbE7&mFt`x1KY>k4(!KbbpZ`>`K@1J<(#vVbjx@Z@(6Q}MF# zMnbr-f55(cTa^q4+#)=s+ThMaV~E`B8V=|W_fZWDwiso8tNMTNse)RNBGi=gVwgg% zbOg8>mbRN%7^Um-7oj4=6`$|(K7!+t^90a{$18Z>}<#!bm%ZEFQ{X(yBZMc>lCz0f1I2w9Sq zuGh<9<=AO&g6BZte6hn>Qmvv;Rt)*cJfTr2=~EnGD8P$v3R|&1RCl&7)b+`=QGapi zPbLg_pxm`+HZurtFZ;wZ=`Vk*do~$wB zxoW&=j0OTbQ=Q%S8XJ%~qoa3Ea|au5o}_(P;=!y-AjFrERh%8la!z6Fn@lR?^E~H12D?8#ht=1F;7@o4$Q8GDj;sSC%Jfn01xgL&%F2 zwG1|5ikb^qHv&9hT8w83+yv&BQXOQyMVJSBL(Ky~p)gU3#%|blG?IR9rP^zUbs7rOA0X52Ao=GRt@C&zlyjNLv-} z9?*x{y(`509qhCV*B47f2hLrGl^<@SuRGR!KwHei?!CM10Tq*YDIoBNyRuO*>3FU? zHjipIE#B~y3FSfOsMfj~F9PNr*H?0oHyYB^G(YyNh{SxcE(Y-`x5jFMKb~HO*m+R% zrq|ic4fzJ#USpTm;X7K+E%xsT_3VHKe?*uc4-FsILUH;kL>_okY(w`VU*8+l>o>Jm ziU#?2^`>arnsl#)*R&nf_%>A+qwl%o{l(u)M?DK1^mf260_oteV3#E_>6Y4!_hhVD zM8AI6MM2V*^_M^sQ0dmHu11fy^kOqXqzpr?K$`}BKWG`=Es(9&S@K@)ZjA{lj3ea7_MBP zk(|hBFRjHVMN!sNUkrB;(cTP)T97M$0Dtc&UXSec<+q?y>5=)}S~{Z@ua;1xt@=T5 zI7{`Z=z_X*no8s>mY;>BvEXK%b`a6(DTS6t&b!vf_z#HM{Uoy_5fiB(zpkF{})ruka$iX*~pq1ZxD?q68dIo zIZSVls9kFGsTwvr4{T_LidcWtt$u{kJlW7moRaH6+A5hW&;;2O#$oKyEN8kx`LmG)Wfq4ykh+q{I3|RfVpkR&QH_x;t41Uw z`P+tft^E2B$domKT@|nNW`EHwyj>&}K;eDpe z1bNOh=fvIfk`&B61+S8ND<(KC%>y&?>opCnY*r5M+!UrWKxv0_QvTlJc>X#AaI^xo zaRXL}t5Ej_Z$y*|w*$6D+A?Lw-CO-$itm^{2Ct82-<0IW)0KMNvJHgBrdsIR0v~=H z?n6^}l{D``Me90`^o|q!olsF?UX3YSq^6Vu>Ijm>>PaZI8G@<^NGw{Cx&%|PwYrfw zR!gX_%AR=L3BFsf8LxI|K^J}deh0ZdV?$3r--FEX`#INxsOG6_=!v)DI>0q|BxT)z z-G6kzA01M?rba+G_mwNMQD1mbVbNTWmBi*{s_v_Ft9m2Avg!^78(QFu&n6mbRJ2bA zv!b;%yo{g*9l2)>tsZJOOp}U~8VUH`}$ z8p_}t*XIOehezolNa-a2x0BS})Y9}&*TPgua{Ewn-=wVrmJUeU39EKx+%w%=ixQWK zDLpwaNJs65#6o7Ln7~~X+p_o2BR1g~VCfxLzxA{HlWAI6^H;`juI=&r1jQrUv_q0Z z1Ja-tjdktrrP>GOC*#p?*xfQU5MqjMsBe!9lh(u8)w$e@Z|>aUHI5o;MGw*|Myiz3 z-f0;pHg~Q#%*Kx8MxH%AluVXjG2C$)WL-K63@Q`#y9_k_+}eR(x4~dp7oV-ek0H>I zgy8p#i4GN{>#v=pFYUQT(g&b$OeTy-X_#FDgNF8XyfGY6R!>inYn8IR2RDa&O!(6< znXs{W!bkP|s_YI*Yx%4stI`=ZO45IK6rBs`g7sP40ic}GZ58s?Mc$&i`kq_tfci>N zIHrC0H+Qpam1bNa=(`SRKjixBTtm&e`j9porEci!zdlg1RI0Jw#b(_Tb@RQK1Zxr_ z%7SUeH6=TrXt3J@js`4iDD0=IoHhK~I7^W8^Rcp~Yaf>2wVe|Hh1bUpX9ATD#moByY57-f2Ef1TP^lBi&p5_s7WGG9|0T}dlfxOx zXvScJO1Cnq`c`~{Dp;{;l<-KkCDE+pmexJkd}zCgE{eF=)K``-qC~IT6GcRog_)!X z?fK^F8UDz$(zFUrwuR$qro5>qqn>+Z%<5>;_*3pZ8QM|yv9CAtrAx;($>4l^_$_-L z*&?(77!-=zvnCVW&kUcZMb6;2!83si518Y%R*A3JZ8Is|kUCMu`!vxDgaWjs7^0j( ziTaS4HhQ)ldR=r)_7vYFUr%THE}cPF{0H45FJ5MQW^+W>P+eEX2kLp3zzFe*-pFVA zdDZRybv?H|>`9f$AKVjFWJ=wegO7hOOIYCtd?Vj{EYLT*^gl35|HQ`R=ti+ADm{jyQE7K@kdjuqJhWVSks>b^ zxha88-h3s;%3_5b1TqFCPTxVjvuB5U>v=HyZ$?JSk+&I%)M7KE*wOg<)1-Iy)8-K! z^XpIt|0ibmk9RtMmlUd7#Ap3Q!q9N4atQy)TmrhrFhfx1DAN`^vq@Q_SRl|V z#lU<~n67$mT)NvHh`%als+G-)x1`Y%4Bp*6Un5Ri9h=_Db zA-AdP!f>f0m@~>7X#uBM?diI@)Egjuz@jXKvm zJo+==juc9_<;CqeRaU9_Mz@;3e=E4=6TK+c`|uu#pIqhSyNm`G(X)&)B`8q0RBv#> z`gGlw(Q=1Xmf55VHj%C#^1lpc>LY8kfA@|rlC1EA<1#`iuyNO z(=;irt{_&K=i4)^x%;U(Xv<)+o=dczC5H3W~+e|f~{*ucxj@{Yi-cw^MqYr3fN zF5D+~!wd$#al?UfMnz(@K#wn`_5na@rRr8XqN@&M&FGEC@`+OEv}sI1hw>Up0qAWf zL#e4~&oM;TVfjRE+10B_gFlLEP9?Q-dARr3xi6nQqnw>k-S;~b z;!0s2VS4}W8b&pGuK=7im+t(`nz@FnT#VD|!)eQNp-W6)@>aA+j~K*H{$G`y2|QHY z|Hmy+CR@#jWY4~)lr1qBJB_RfHJFfP<}pK5(#ZZGSqcpyS&}01LnTWk5fzmXMGHkJ zTP6L^B+uj;lmB_W<~4=${+v0>z31M!-_O@o-O9GyW)j_mjx}!0@br_LE-7SIuPP84 z;5=O(U*g_um0tyG|61N@d9lEuOeiRd+#NY^{nd5;-CVlw&Ap7J?qwM^?E29wvS}2d zbzar4Fz&RSR(-|s!Z6+za&Z zY#D<5q_JUktIzvL0)yq_kLWG6DO{ri=?c!y!f(Dk%G{8)k`Gym%j#!OgXVDD3;$&v@qy#ISJfp=Vm>pls@9-mapVQChAHHd-x+OGx)(*Yr zC1qDUTZ6mM(b_hi!TuFF2k#8uI2;kD70AQ&di$L*4P*Y-@p`jdm%_c3f)XhYD^6M8&#Y$ZpzQMcR|6nsH>b=*R_Von!$BTRj7yGCXokoAQ z&ANvx0-Epw`QIEPgI(^cS2f(Y85yV@ygI{ewyv5Frng)e}KCZF7JbR(&W618_dcEh(#+^zZFY;o<815<5sOHQdeax9_!PyM&;{P zkBa5xymca0#)c#tke@3KNEM8a_mT&1gm;p&&JlMGH(cL(b)BckgMQ^9&vRwj!~3@l zY?L5}=Jzr080OGKb|y`ee(+`flQg|!lo6>=H)X4`$Gz~hLmu2a%kYW_Uu8x09Pa0J zKZ`E$BKJ=2GPj_3l*TEcZ*uYRr<*J^#5pILTT;k_cgto1ZL-%slyc16J~OH-(RgDA z%;EjEnoUkZ&acS{Q8`{i6T5^nywgqQI5bDIymoa7CSZG|WWVk>GM9)zy*bNih|QIm z%0+(Nnc*a_xo;$=!HQYaapLms>J1ToyjtFByY`C2H1wT#178#4+|{H0BBqtCdd$L% z_3Hc60j@{t9~MjM@LBalR&6@>B;9?r<7J~F+WXyYu*y3?px*=8MAK@EA+jRX8{CG?GI-< z54?Dc9CAh>QTAvyOEm0^+x;r2BWX|{3$Y7)L5l*qVE*y0`7J>l2wCmW zL1?|a`pJ-l{fb_N;R(Z9UMiSj6pQjOvQ^%DvhIJF!+Th7jO2~1f1N+(-TyCFYQZYw z4)>7caf^Ki_KJ^Zx2JUb z&$3zJy!*+rCV4%jqwyuNY3j1ZEiltS0xTzd+=itTb;IPYpaf?8Y+RSdVdpacB(bVQ zC(JupLfFp8y43%PMj2}T|VS@%LVp>hv4Y!RPMF?pp8U_$xCJ)S zQx!69>bphNTIb9yn*_yfj{N%bY)t{L1cs8<8|!f$;UQ*}IN=2<6lA;x^(`8t?;+ST zh)z4qeYYgZkIy{$4x28O-pugO&gauRh3;lti9)9Pvw+^)0!h~%m&8Q!AKX%urEMnl z?yEz?g#ODn$UM`+Q#$Q!6|zsq_`dLO5YK-6bJM6ya>}H+vnW^h?o$z;V&wvuM$dR& zeEq;uUUh$XR`TWeC$$c&Jjau2it3#%J-y}Qm>nW*s?En?R&6w@sDXMEr#8~$=b(gk zwDC3)NtAP;M2BW_lL^5ShpK$D%@|BnD{=!Tq)o(5@z3i7Z){} zGr}Exom_qDO{kAVkZ*MbLNHE666Kina#D{&>Jy%~w7yX$oj;cYCd^p9zy z8*+wgSEcj$4{WxKmCF(5o7U4jqwEvO&dm1H#7z}%VXAbW&W24v-tS6N3}qrm1OnE)fUkoE8yMMn9S$?IswS88tQWm4#Oid#ckgr6 zRtHm!mfNl-`d>O*1~d7%;~n+{Rph6BBy^95zqI{K((E!iFQ+h*C3EsbxNo_aRm5gj zKYug($r*Q#W9`p%Bf{bi6;IY0v`pB^^qu)gbg9QHQ7 zWBj(a1YSu)~2RK8Pi#C>{DMlrqFb9e_RehEHyI{n?e3vL_}L>kYJC z_ly$$)zFi*SFyNrnOt(B*7E$??s67EO%DgoZL2XNk8iVx~X_)o++4oaK1M|ou73vA0K^503j@uuVmLcHH4ya-kOIDfM%5%(E z+Xpt~#7y2!KB&)PoyCA+$~DXqxPxxALy!g-O?<9+9KTk4Pgq4AIdUkl`1<1#j^cJg zgU3`0hkHj_jxV>`Y~%LAZl^3o0}`Sm@iw7kwff{M%VwtN)|~!p{AsfA6vB5UolF~d zHWS%*uBDt<9y!9v2Xe|au&1j&iR1HXCdyCjxSgG*L{wmTD4(NQ=mFjpa~xooc6kju z`~+d{j7$h-;HAB04H!Zscu^hZffL#9!p$)9>sRI|Yovm)g@F>ZnosF2EgkU3ln0bR zTA}|+E(tt)!SG)-bEJi_0m{l+(cAz^pi}`9=~n?y&;2eG;d9{M6nj>BHGn(KA2n|O zt}$=FPq!j`p&kQ8>cirSzkU0c08%8{^Qyqi-w2LoO8)^E7;;I1;HQ6B$u0nNaX2CY zSmfi)F`m94zL8>#zu;8|{aBui@RzRKBlP1&mfFxEC@%cjl?NBs`cr^nm){>;$g?rhKr$AO&6qV_Wbn^}5tfFBry^e1`%du2~o zs$~dN;S_#%iwwA_QvmMjh%Qo?0?rR~6liyN5Xmej8(*V9ym*T`xAhHih-v$7U}8=dfXi2i*aAB!xM(Xekg*ix@r|ymDw*{*s0?dlVys2e)z62u1 z+k3esbJE=-P5S$&KdFp+2H7_2e=}OKDrf( z9-207?6$@f4m4B+9E*e((Y89!q?zH|mz_vM>kp*HGXldO0Hg#!EtFhRuOm$u8e~a9 z5(roy7m$Kh+zjW6@zw{&20u?1f2uP&boD}$#Zy)4o&T;vyBoqFiF2t;*g=|1=)PxB z8eM3Mp=l_obbc?I^xyLz?4Y1YDWPa+nm;O<$Cn;@ane616`J9OO2r=rZr{I_Kizyc zP#^^WCdIEp*()rRT+*YZK>V@^Zs=ht32x>Kwe zab)@ZEffz;VM4{XA6e421^h~`ji5r%)B{wZu#hD}f3$y@L0JV9f3g{-RK!A?vBUA}${YF(vO4)@`6f1 z-A|}e#LN{)(eXloDnX4Vs7eH|<@{r#LodP@Nz--$Dg_Par%DCpu2>2jUnqy~|J?eZ zBG4FVsz_A+ibdwv>mLp>P!(t}E>$JGaK$R~;fb{O3($y1ssQQo|5M;^JqC?7qe|hg zu0ZOqeFcp?qVn&Qu7FQJ4hcFi&|nR!*j)MF#b}QO^lN%5)4p*D^H+B){n8%VPUzi! zDihoGcP71a6!ab`l^hK&*dYrVYzJ0)#}xVrp!e;lI!+x+bfCN0KXwUAPU9@#l7@0& QuEJmfE|#`Dqx|px0L@K;Y5)KL diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 774fae8..5c6f89d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 005bcde..9d0ce63 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 6a68175..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/openapi-config.yaml b/openapi-config.yaml index 898de7d..eddaeeb 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -3,10 +3,8 @@ additionalProperties: library: jersey3 openApiNullable: false java8: true - # TODO preferably remove threetenbp (https://github.com/OpenAPITools/openapi-generator/pull/10025) - threetenbp: true useJakartaEe: true - swagger1AnnotationLibrary: true + swagger1AnnotationLibrary: false invokerPackage: com.dropbox.sign apiPackage: com.dropbox.sign.api modelPackage: com.dropbox.sign.model @@ -20,7 +18,7 @@ additionalProperties: groupId: com.dropbox.sign artifactId: dropbox-sign artifactName: Dropbox Sign Java SDK - artifactVersion: "2.1.0" + artifactVersion: "2.2.0" artifactUrl: https://github.com/hellosign/dropbox-sign-java artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git @@ -28,14 +26,11 @@ additionalProperties: scmUrl: https://github.com/hellosign/dropbox-sign-java licenseName: MIT License licenseUrl: https://www.opensource.org/licenses/mit-license.php - + useCustomTemplateCode: true files: EventCallbackHelper.mustache: templateType: SupportingFiles destinationFilename: src/main/java/com/dropbox/sign/EventCallbackHelper.java - CustomInstantDeserializer.mustache: - templateType: SupportingFiles - destinationFilename: src/main/java/com/dropbox/sign/CustomInstantDeserializer.java VERSION.mustache: templateType: SupportingFiles destinationFilename: VERSION 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/pom.xml b/pom.xml index 7ad2f97..dcf54b3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ dropbox-sign jar dropbox-sign - 2.1.0 + 2.2.0 https://github.com/hellosign/dropbox-sign-java Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! @@ -58,12 +58,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -268,9 +268,9 @@ - io.swagger - swagger-annotations - ${swagger-annotations-version} + commons-codec + commons-codec + 1.15 @@ -323,11 +323,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -341,8 +336,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -355,14 +350,12 @@ UTF-8 - 1.6.6 - 3.0.4 - 2.13.4 - 2.13.4.2 + 3.1.1 + 2.17.1 + 2.17.1 0.2.6 - 2.9.10 - 2.1.0 - 4.13.1 + 2.1.1 + 5.10.0 2.21.0 3.12.4 diff --git a/run-build b/run-build index 8bcce9f..1e1cfec 100755 --- a/run-build +++ b/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/v5.4.0/modules/openapi-generator/src/main/resources/Java +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/Java set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/java" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v7.0.1 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/src/main/java/com/dropbox/sign/ApiClient.java b/src/main/java/com/dropbox/sign/ApiClient.java index 8b3cf39..4119fb8 100644 --- a/src/main/java/com/dropbox/sign/ApiClient.java +++ b/src/main/java/com/dropbox/sign/ApiClient.java @@ -1,3 +1,16 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.dropbox.sign; import jakarta.ws.rs.client.Client; @@ -51,7 +64,7 @@ import java.util.Date; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -66,13 +79,12 @@ import com.dropbox.sign.auth.HttpBasicAuth; import com.dropbox.sign.auth.HttpBearerAuth; import com.dropbox.sign.auth.ApiKeyAuth; - import com.dropbox.sign.model.ErrorResponse; /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiClient extends JavaTimeFormatter { private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); @@ -94,7 +106,7 @@ public class ApiClient extends JavaTimeFormatter { protected Map> operationServers; { - Map> operationServers = new LinkedHashMap<>(); + Map> operationServers = new HashMap<>(); operationServers.put("OAuthApi.oauthTokenGenerate", new ArrayList<>(Arrays.asList( new ServerConfiguration( "https://app.hellosign.com", @@ -147,7 +159,7 @@ public ApiClient(Map authMap) { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2.1.0/java"); + setUserAgent("OpenAPI-Generator/2.2.0/java"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>(); @@ -197,7 +209,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link jakarta.ws.rs.client.Client} object. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -217,7 +229,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -237,7 +249,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -258,7 +270,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -279,7 +291,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -316,7 +328,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -332,7 +344,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -348,7 +360,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -363,11 +375,49 @@ public ApiClient setApiKey(String apiKey) { throw new RuntimeException("No API key authentication configured!"); } + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + /** * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -383,7 +433,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -405,7 +455,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -417,7 +467,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -437,7 +487,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -459,7 +509,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -483,7 +533,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -505,7 +555,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -528,7 +578,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -549,7 +599,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -595,9 +645,9 @@ public String parameterToString(Object param) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -623,9 +673,9 @@ public List parameterToPairs(String collectionFormat, String name, Object // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/src/main/java/com/dropbox/sign/ApiException.java b/src/main/java/com/dropbox/sign/ApiException.java index bf2ea9a..2d61576 100644 --- a/src/main/java/com/dropbox/sign/ApiException.java +++ b/src/main/java/com/dropbox/sign/ApiException.java @@ -13,15 +13,17 @@ package com.dropbox.sign; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; +import com.dropbox.sign.model.ErrorResponse; /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; diff --git a/src/main/java/com/dropbox/sign/Configuration.java b/src/main/java/com/dropbox/sign/Configuration.java index 8d952f1..f337e41 100644 --- a/src/main/java/com/dropbox/sign/Configuration.java +++ b/src/main/java/com/dropbox/sign/Configuration.java @@ -13,8 +13,10 @@ package com.dropbox.sign; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Configuration { + public static final String VERSION = "2.2.0"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java b/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java deleted file mode 100644 index a58fea4..0000000 --- a/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.dropbox.sign; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/src/main/java/com/dropbox/sign/EventCallbackHelper.java b/src/main/java/com/dropbox/sign/EventCallbackHelper.java index e28824f..2470e2b 100644 --- a/src/main/java/com/dropbox/sign/EventCallbackHelper.java +++ b/src/main/java/com/dropbox/sign/EventCallbackHelper.java @@ -18,7 +18,7 @@ import org.apache.commons.codec.digest.HmacAlgorithms; import org.apache.commons.codec.digest.HmacUtils; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class EventCallbackHelper { public static final String EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; diff --git a/src/main/java/com/dropbox/sign/JSON.java b/src/main/java/com/dropbox/sign/JSON.java index 6f8a99b..68a3518 100644 --- a/src/main/java/com/dropbox/sign/JSON.java +++ b/src/main/java/com/dropbox/sign/JSON.java @@ -1,11 +1,22 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.dropbox.sign; -import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import com.dropbox.sign.model.*; import java.text.DateFormat; @@ -16,26 +27,21 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - ThreeTenModule threeTenModule = new ThreeTenModule(); - threeTenModule.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - threeTenModule.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - threeTenModule.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) .defaultDateFormat(new RFC3339DateFormat()) .addModule(new JavaTimeModule()) - .addModule(threeTenModule) .build(); } @@ -173,7 +179,6 @@ Class getClassForElement(JsonNode node, Set> visitedClasses) { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { - // This handles the 'allOf' use case with single parent inheritance. return true; } if (visitedClasses.contains(modelClass)) { @@ -184,9 +189,9 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -203,7 +208,7 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -223,7 +228,7 @@ public static void registerDiscriminator(Class modelClass, String discriminat * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/src/main/java/com/dropbox/sign/JavaTimeFormatter.java b/src/main/java/com/dropbox/sign/JavaTimeFormatter.java index f6d2369..f91775b 100644 --- a/src/main/java/com/dropbox/sign/JavaTimeFormatter.java +++ b/src/main/java/com/dropbox/sign/JavaTimeFormatter.java @@ -12,15 +12,15 @@ package com.dropbox.sign; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/src/main/java/com/dropbox/sign/Pair.java b/src/main/java/com/dropbox/sign/Pair.java index 895bda4..271555c 100644 --- a/src/main/java/com/dropbox/sign/Pair.java +++ b/src/main/java/com/dropbox/sign/Pair.java @@ -13,7 +13,7 @@ package com.dropbox.sign; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/dropbox/sign/RFC3339DateFormat.java b/src/main/java/com/dropbox/sign/RFC3339DateFormat.java index 6187eb3..df30003 100644 --- a/src/main/java/com/dropbox/sign/RFC3339DateFormat.java +++ b/src/main/java/com/dropbox/sign/RFC3339DateFormat.java @@ -18,9 +18,11 @@ import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); @@ -31,6 +33,7 @@ public class RFC3339DateFormat extends DateFormat { public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); } @Override @@ -52,4 +55,4 @@ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fie public Object clone() { return super.clone(); } -} \ No newline at end of file +} diff --git a/src/main/java/com/dropbox/sign/ServerConfiguration.java b/src/main/java/com/dropbox/sign/ServerConfiguration.java index f275a14..cb85f1c 100644 --- a/src/main/java/com/dropbox/sign/ServerConfiguration.java +++ b/src/main/java/com/dropbox/sign/ServerConfiguration.java @@ -1,3 +1,16 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.dropbox.sign; import java.util.Map; @@ -5,6 +18,7 @@ /** * Representing a Server configuration. */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerConfiguration { public String URL; public String description; @@ -39,10 +53,10 @@ public String URL(Map variables) { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/src/main/java/com/dropbox/sign/ServerVariable.java b/src/main/java/com/dropbox/sign/ServerVariable.java index d38fd30..c40ffb4 100644 --- a/src/main/java/com/dropbox/sign/ServerVariable.java +++ b/src/main/java/com/dropbox/sign/ServerVariable.java @@ -1,3 +1,16 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.dropbox.sign; import java.util.HashSet; @@ -5,6 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/com/dropbox/sign/StringUtil.java b/src/main/java/com/dropbox/sign/StringUtil.java index 6a27049..f3bd08f 100644 --- a/src/main/java/com/dropbox/sign/StringUtil.java +++ b/src/main/java/com/dropbox/sign/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/dropbox/sign/api/AccountApi.java b/src/main/java/com/dropbox/sign/api/AccountApi.java index f199883..9c7be32 100644 --- a/src/main/java/com/dropbox/sign/api/AccountApi.java +++ b/src/main/java/com/dropbox/sign/api/AccountApi.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AccountApi { private ApiClient apiClient; @@ -85,47 +85,33 @@ public AccountCreateResponse accountCreate(AccountCreateRequest accountCreateReq */ public ApiResponse accountCreateWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException { - Object localVarPostBody = accountCreateRequest; - - // verify the required parameter 'accountCreateRequest' is set + // Check required parameters if (accountCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountCreateRequest' when calling accountCreate"); } - - // create path and map variables - String localVarPath = "/account/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountCreate", + "/account/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Account @@ -201,44 +187,34 @@ public ApiResponse accountGetWithHttpInfo(String accountId) */ public ApiResponse accountGetWithHttpInfo(String accountId, String emailAddress) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/account"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountGet", + "/account", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Account @@ -273,47 +249,33 @@ public AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateReques */ public ApiResponse accountUpdateWithHttpInfo(AccountUpdateRequest accountUpdateRequest) throws ApiException { - Object localVarPostBody = accountUpdateRequest; - - // verify the required parameter 'accountUpdateRequest' is set + // Check required parameters if (accountUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountUpdateRequest' when calling accountUpdate"); } - - // create path and map variables - String localVarPath = "/account"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountUpdate", + "/account", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : accountUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Verify Account @@ -348,46 +310,32 @@ public AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyReq */ public ApiResponse accountVerifyWithHttpInfo(AccountVerifyRequest accountVerifyRequest) throws ApiException { - Object localVarPostBody = accountVerifyRequest; - - // verify the required parameter 'accountVerifyRequest' is set + // Check required parameters if (accountVerifyRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountVerifyRequest' when calling accountVerify"); } - - // create path and map variables - String localVarPath = "/account/verify"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountVerifyRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountVerify", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountVerify", + "/account/verify", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountVerifyRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/ApiAppApi.java b/src/main/java/com/dropbox/sign/api/ApiAppApi.java index bd03c34..affb3cc 100644 --- a/src/main/java/com/dropbox/sign/api/ApiAppApi.java +++ b/src/main/java/com/dropbox/sign/api/ApiAppApi.java @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiAppApi { private ApiClient apiClient; @@ -83,47 +83,33 @@ public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) t */ public ApiResponse apiAppCreateWithHttpInfo(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { - Object localVarPostBody = apiAppCreateRequest; - - // verify the required parameter 'apiAppCreateRequest' is set + // Check required parameters if (apiAppCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'apiAppCreateRequest' when calling apiAppCreate"); } - - // create path and map variables - String localVarPath = "/api_app"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = apiAppCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppCreate", + "/api_app", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : apiAppCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Delete API App @@ -157,46 +143,36 @@ public void apiAppDelete(String clientId) throws ApiException { */ public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppDelete"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("ApiAppApi.apiAppDelete", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Get API App @@ -231,48 +207,37 @@ public ApiAppGetResponse apiAppGet(String clientId) throws ApiException { */ public ApiResponse apiAppGetWithHttpInfo(String clientId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppGet"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List API Apps @@ -354,44 +319,34 @@ public ApiResponse apiAppListWithHttpInfo(Integer page, Inte if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api_app/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppList", + "/api_app/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update API App @@ -428,52 +383,39 @@ public ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAp */ public ApiResponse apiAppUpdateWithHttpInfo(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { - Object localVarPostBody = apiAppUpdateRequest; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); } - - // verify the required parameter 'apiAppUpdateRequest' is set if (apiAppUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'apiAppUpdateRequest' when calling apiAppUpdate"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = apiAppUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppUpdate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : apiAppUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java b/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java index e3550d1..ba55d19 100644 --- a/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java +++ b/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class BulkSendJobApi { private ApiClient apiClient; @@ -130,50 +130,43 @@ public ApiResponse bulkSendJobGetWithHttpInfo(String bul if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'bulkSendJobId' is set + // Check required parameters if (bulkSendJobId == null) { throw new ApiException(400, "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); } - - // create path and map variables - String localVarPath = "/bulk_send_job/{bulk_send_job_id}" - .replaceAll("\\{" + "bulk_send_job_id" + "\\}", apiClient.escapeString(bulkSendJobId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/bulk_send_job/{bulk_send_job_id}" + .replaceAll("\\{bulk_send_job_id}", apiClient.escapeString(bulkSendJobId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("BulkSendJobApi.bulkSendJobGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobGet", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Bulk Send Jobs @@ -255,43 +248,33 @@ public ApiResponse bulkSendJobListWithHttpInfo(Integer if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/bulk_send_job/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("BulkSendJobApi.bulkSendJobList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobList", + "/bulk_send_job/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/EmbeddedApi.java b/src/main/java/com/dropbox/sign/api/EmbeddedApi.java index 8f541c3..595d0df 100644 --- a/src/main/java/com/dropbox/sign/api/EmbeddedApi.java +++ b/src/main/java/com/dropbox/sign/api/EmbeddedApi.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class EmbeddedApi { private ApiClient apiClient; @@ -84,53 +84,40 @@ public EmbeddedEditUrlResponse embeddedEditUrl(String templateId, EmbeddedEditUr */ public ApiResponse embeddedEditUrlWithHttpInfo(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - Object localVarPostBody = embeddedEditUrlRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling embeddedEditUrl"); } - - // verify the required parameter 'embeddedEditUrlRequest' is set if (embeddedEditUrlRequest == null) { throw new ApiException(400, "Missing the required parameter 'embeddedEditUrlRequest' when calling embeddedEditUrl"); } - - // create path and map variables - String localVarPath = "/embedded/edit_url/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/embedded/edit_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = embeddedEditUrlRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("EmbeddedApi.embeddedEditUrl", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "EmbeddedApi.embeddedEditUrl", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : embeddedEditUrlRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Embedded Sign URL @@ -165,47 +152,36 @@ public EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiExc */ public ApiResponse embeddedSignUrlWithHttpInfo(String signatureId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureId' is set + // Check required parameters if (signatureId == null) { throw new ApiException(400, "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); } - - // create path and map variables - String localVarPath = "/embedded/sign_url/{signature_id}" - .replaceAll("\\{" + "signature_id" + "\\}", apiClient.escapeString(signatureId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/embedded/sign_url/{signature_id}" + .replaceAll("\\{signature_id}", apiClient.escapeString(signatureId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("EmbeddedApi.embeddedSignUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "EmbeddedApi.embeddedSignUrl", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/FaxLineApi.java b/src/main/java/com/dropbox/sign/api/FaxLineApi.java new file mode 100644 index 0000000..17558c6 --- /dev/null +++ b/src/main/java/com/dropbox/sign/api/FaxLineApi.java @@ -0,0 +1,661 @@ +package com.dropbox.sign.api; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiResponse; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import jakarta.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; +import com.dropbox.sign.model.FaxLineAddUserRequest; +import com.dropbox.sign.model.FaxLineAreaCodeGetResponse; +import com.dropbox.sign.model.FaxLineCreateRequest; +import com.dropbox.sign.model.FaxLineDeleteRequest; +import com.dropbox.sign.model.FaxLineListResponse; +import com.dropbox.sign.model.FaxLineRemoveUserRequest; +import com.dropbox.sign.model.FaxLineResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +public class FaxLineApi { + private ApiClient apiClient; + + public FaxLineApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxLineApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + return faxLineAddUserWithHttpInfo(faxLineAddUserRequest).getData(); + } + + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + + // Check required parameters + if (faxLineAddUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineAddUserRequest' when calling faxLineAddUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineAddUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineAddUser", + "/fax_line/add_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Get Available Fax Line Area Codes + * Returns a response with the area codes available for a given state/provice and city. + * @param country Filter area codes by country. (required) + * @param state Filter area codes by state. (optional) + * @param province Filter area codes by province. (optional) + * @param city Filter area codes by city. (optional) + * @return FaxLineAreaCodeGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province, String city) throws ApiException { + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + + /** + * Get Available Fax Line Area Codes + * Returns a response with the area codes available for a given state/provice and city. + * @param country Filter area codes by country. (required) + * @param state Filter area codes by state. (optional) + * @param province Filter area codes by province. (optional) + * @param city Filter area codes by city. (optional) + * @return ApiResponse<FaxLineAreaCodeGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state, String province, String city) throws ApiException { + + // Check required parameters + if (country == null) { + throw new ApiException(400, "Missing the required parameter 'country' when calling faxLineAreaCodeGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "country", country) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "state", state)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "province", province)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "city", city)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineAreaCodeGet", + "/fax_line/area_codes", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Purchase Fax Line + * Purchases a new Fax Line. + * @param faxLineCreateRequest (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineCreate(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + return faxLineCreateWithHttpInfo(faxLineCreateRequest).getData(); + } + + + /** + * Purchase Fax Line + * Purchases a new Fax Line. + * @param faxLineCreateRequest (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + + // Check required parameters + if (faxLineCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineCreateRequest' when calling faxLineCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineCreate", + "/fax_line/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxLineCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + faxLineDeleteWithHttpInfo(faxLineDeleteRequest); + } + + + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + + // Check required parameters + if (faxLineDeleteRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineDeleteRequest' when calling faxLineDelete"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineDeleteRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineDelete", + "/fax_line", + "DELETE", + new ArrayList<>(), + isFileTypeFound ? null : faxLineDeleteRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + } + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number. (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineGet(String number) throws ApiException { + return faxLineGetWithHttpInfo(number).getData(); + } + + + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number. (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineGetWithHttpInfo(String number) throws ApiException { + + // Check required parameters + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling faxLineGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "number", number) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineGet", + "/fax_line", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) + * @param showTeamLines Show team lines (optional) + * @return FaxLineListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) + * @param showTeamLines Show team lines (optional) + * @return ApiResponse<FaxLineListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "show_team_lines", showTeamLines)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineList", + "/fax_line/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line. + * @param faxLineRemoveUserRequest (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + return faxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest).getData(); + } + + + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line. + * @param faxLineRemoveUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + + // Check required parameters + if (faxLineRemoveUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineRemoveUserRequest' when calling faxLineRemoveUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineRemoveUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineRemoveUser", + "/fax_line/remove_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } +} \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/OAuthApi.java b/src/main/java/com/dropbox/sign/api/OAuthApi.java index cbd0ce0..be092da 100644 --- a/src/main/java/com/dropbox/sign/api/OAuthApi.java +++ b/src/main/java/com/dropbox/sign/api/OAuthApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class OAuthApi { private ApiClient apiClient; @@ -79,47 +79,32 @@ public OAuthTokenResponse oauthTokenGenerate(OAuthTokenGenerateRequest oauthToke */ public ApiResponse oauthTokenGenerateWithHttpInfo(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - Object localVarPostBody = oauthTokenGenerateRequest; - - // verify the required parameter 'oauthTokenGenerateRequest' is set + // Check required parameters if (oauthTokenGenerateRequest == null) { throw new ApiException(400, "Missing the required parameter 'oauthTokenGenerateRequest' when calling oauthTokenGenerate"); } - - // create path and map variables - String localVarPath = "/oauth/token"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = oauthTokenGenerateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("OAuthApi.oauthTokenGenerate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "OAuthApi.oauthTokenGenerate", + "/oauth/token", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenGenerateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); } /** * OAuth Token Refresh @@ -152,46 +137,31 @@ public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenR */ public ApiResponse oauthTokenRefreshWithHttpInfo(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { - Object localVarPostBody = oauthTokenRefreshRequest; - - // verify the required parameter 'oauthTokenRefreshRequest' is set + // Check required parameters if (oauthTokenRefreshRequest == null) { throw new ApiException(400, "Missing the required parameter 'oauthTokenRefreshRequest' when calling oauthTokenRefresh"); } - - // create path and map variables - String localVarPath = "/oauth/token?refresh"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = oauthTokenRefreshRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("OAuthApi.oauthTokenRefresh", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "OAuthApi.oauthTokenRefresh", + "/oauth/token?refresh", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenRefreshRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/ReportApi.java b/src/main/java/com/dropbox/sign/api/ReportApi.java index 2400282..ae34355 100644 --- a/src/main/java/com/dropbox/sign/api/ReportApi.java +++ b/src/main/java/com/dropbox/sign/api/ReportApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ReportApi { private ApiClient apiClient; @@ -81,46 +81,32 @@ public ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest */ public ApiResponse reportCreateWithHttpInfo(ReportCreateRequest reportCreateRequest) throws ApiException { - Object localVarPostBody = reportCreateRequest; - - // verify the required parameter 'reportCreateRequest' is set + // Check required parameters if (reportCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'reportCreateRequest' when calling reportCreate"); } - - // create path and map variables - String localVarPath = "/report/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = reportCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ReportApi.reportCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ReportApi.reportCreate", + "/report/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : reportCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java b/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index 9ee38a8..78058b1 100644 --- a/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class SignatureRequestApi { private ApiClient apiClient; @@ -93,47 +93,33 @@ public BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate(Si */ public ApiResponse signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestBulkCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling signatureRequestBulkCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/bulk_create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", + "/signature_request/bulk_create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Bulk Send with Template @@ -168,47 +154,33 @@ public BulkSendJobSendResponse signatureRequestBulkSendWithTemplate(SignatureReq */ public ApiResponse signatureRequestBulkSendWithTemplateWithHttpInfo(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestBulkSendWithTemplateRequest; - - // verify the required parameter 'signatureRequestBulkSendWithTemplateRequest' is set + // Check required parameters if (signatureRequestBulkSendWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest' when calling signatureRequestBulkSendWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/bulk_send_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestBulkSendWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkSendWithTemplate", + "/signature_request/bulk_send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Cancel Incomplete Signature Request @@ -242,46 +214,36 @@ public void signatureRequestCancel(String signatureRequestId) throws ApiExceptio */ public ApiResponse signatureRequestCancelWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestCancel"); } - - // create path and map variables - String localVarPath = "/signature_request/cancel/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/cancel/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCancel", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCancel", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Create Embedded Signature Request @@ -316,47 +278,33 @@ public SignatureRequestGetResponse signatureRequestCreateEmbedded(SignatureReque */ public ApiResponse signatureRequestCreateEmbeddedWithHttpInfo(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { - Object localVarPostBody = signatureRequestCreateEmbeddedRequest; - - // verify the required parameter 'signatureRequestCreateEmbeddedRequest' is set + // Check required parameters if (signatureRequestCreateEmbeddedRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when calling signatureRequestCreateEmbedded"); } - - // create path and map variables - String localVarPath = "/signature_request/create_embedded"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCreateEmbedded", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbedded", + "/signature_request/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Signature Request with Template @@ -391,47 +339,33 @@ public SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate(Si */ public ApiResponse signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling signatureRequestCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", + "/signature_request/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Download Files @@ -490,49 +424,42 @@ public ApiResponse signatureRequestFilesWithHttpInfo(String signatureReque if (fileType == null) { fileType = "pdf"; } - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFiles"); } - - // create path and map variables - String localVarPath = "/signature_request/files/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "file_type", fileType)); - - - - - final String[] localVarAccepts = { - "application/pdf", "application/zip", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/signature_request/files/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFiles", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Download Files as Data Uri @@ -567,48 +494,37 @@ public FileResponseDataUri signatureRequestFilesAsDataUri(String signatureReques */ public ApiResponse signatureRequestFilesAsDataUriWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsDataUri"); } - - // create path and map variables - String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFilesAsDataUri", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Download Files as File Url @@ -667,49 +583,42 @@ public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo(Stri if (forceDownload == null) { forceDownload = 1; } - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsFileUrl"); } - - // create path and map variables - String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "force_download", forceDownload)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFilesAsFileUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Signature Request @@ -744,48 +653,37 @@ public SignatureRequestGetResponse signatureRequestGet(String signatureRequestId */ public ApiResponse signatureRequestGetWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestGet"); } - - // create path and map variables - String localVarPath = "/signature_request/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Signature Requests @@ -917,46 +815,36 @@ public ApiResponse signatureRequestListWithHttpInf if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/signature_request/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestList", + "/signature_request/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Release On-Hold Signature Request @@ -991,48 +879,37 @@ public SignatureRequestGetResponse signatureRequestReleaseHold(String signatureR */ public ApiResponse signatureRequestReleaseHoldWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestReleaseHold"); } - - // create path and map variables - String localVarPath = "/signature_request/release_hold/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/release_hold/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestReleaseHold", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestReleaseHold", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Send Request Reminder @@ -1069,53 +946,40 @@ public SignatureRequestGetResponse signatureRequestRemind(String signatureReques */ public ApiResponse signatureRequestRemindWithHttpInfo(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { - Object localVarPostBody = signatureRequestRemindRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemind"); } - - // verify the required parameter 'signatureRequestRemindRequest' is set if (signatureRequestRemindRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestRemindRequest' when calling signatureRequestRemind"); } - - // create path and map variables - String localVarPath = "/signature_request/remind/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/signature_request/remind/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestRemindRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestRemind", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemind", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestRemindRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Remove Signature Request Access @@ -1149,46 +1013,36 @@ public void signatureRequestRemove(String signatureRequestId) throws ApiExceptio */ public ApiResponse signatureRequestRemoveWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemove"); } - - // create path and map variables - String localVarPath = "/signature_request/remove/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/remove/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestRemove", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemove", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Send Signature Request @@ -1223,47 +1077,33 @@ public SignatureRequestGetResponse signatureRequestSend(SignatureRequestSendRequ */ public ApiResponse signatureRequestSendWithHttpInfo(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - Object localVarPostBody = signatureRequestSendRequest; - - // verify the required parameter 'signatureRequestSendRequest' is set + // Check required parameters if (signatureRequestSendRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestSendRequest' when calling signatureRequestSend"); } - - // create path and map variables - String localVarPath = "/signature_request/send"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestSendRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestSend", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSend", + "/signature_request/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Send with Template @@ -1298,47 +1138,33 @@ public SignatureRequestGetResponse signatureRequestSendWithTemplate(SignatureReq */ public ApiResponse signatureRequestSendWithTemplateWithHttpInfo(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestSendWithTemplateRequest; - - // verify the required parameter 'signatureRequestSendWithTemplateRequest' is set + // Check required parameters if (signatureRequestSendWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when calling signatureRequestSendWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/send_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestSendWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSendWithTemplate", + "/signature_request/send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Signature Request @@ -1375,52 +1201,39 @@ public SignatureRequestGetResponse signatureRequestUpdate(String signatureReques */ public ApiResponse signatureRequestUpdateWithHttpInfo(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { - Object localVarPostBody = signatureRequestUpdateRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestUpdate"); } - - // verify the required parameter 'signatureRequestUpdateRequest' is set if (signatureRequestUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestUpdateRequest' when calling signatureRequestUpdate"); } - - // create path and map variables - String localVarPath = "/signature_request/update/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/signature_request/update/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestUpdate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestUpdate", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/TeamApi.java b/src/main/java/com/dropbox/sign/api/TeamApi.java index 8959061..b1b3811 100644 --- a/src/main/java/com/dropbox/sign/api/TeamApi.java +++ b/src/main/java/com/dropbox/sign/api/TeamApi.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TeamApi { private ApiClient apiClient; @@ -109,48 +109,38 @@ public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberReque */ public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { - Object localVarPostBody = teamAddMemberRequest; - - // verify the required parameter 'teamAddMemberRequest' is set + // Check required parameters if (teamAddMemberRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamAddMemberRequest' when calling teamAddMember"); } - - // create path and map variables - String localVarPath = "/team/add_member"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "team_id", teamId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamAddMemberRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamAddMember", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamAddMember", + "/team/add_member", + "PUT", + localVarQueryParams, + isFileTypeFound ? null : teamAddMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Team @@ -185,47 +175,33 @@ public TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws Ap */ public ApiResponse teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) throws ApiException { - Object localVarPostBody = teamCreateRequest; - - // verify the required parameter 'teamCreateRequest' is set + // Check required parameters if (teamCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); } - - // create path and map variables - String localVarPath = "/team/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamCreate", + "/team/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Delete Team @@ -257,40 +233,27 @@ public void teamDelete() throws ApiException { */ public ApiResponse teamDeleteWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/destroy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("TeamApi.teamDelete", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "TeamApi.teamDelete", + "/team/destroy", + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Get Team @@ -323,42 +286,28 @@ public TeamGetResponse teamGet() throws ApiException { */ public ApiResponse teamGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamGet", + "/team", + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Team Info @@ -412,43 +361,33 @@ public ApiResponse teamInfoWithHttpInfo() throws ApiExcepti */ public ApiResponse teamInfoWithHttpInfo(String teamId) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/info"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "team_id", teamId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamInfo", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamInfo", + "/team/info", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Team Invites @@ -502,43 +441,33 @@ public ApiResponse teamInvitesWithHttpInfo() throws ApiExce */ public ApiResponse teamInvitesWithHttpInfo(String emailAddress) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/invites"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "email_address", emailAddress) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamInvites", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamInvites", + "/team/invites", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Team Members @@ -622,50 +551,43 @@ public ApiResponse teamMembersWithHttpInfo(String teamId, I if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'teamId' is set + // Check required parameters if (teamId == null) { throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamMembers"); } - - // create path and map variables - String localVarPath = "/team/members/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/team/members/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamMembers", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamMembers", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Remove User from Team @@ -700,47 +622,33 @@ public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMember */ public ApiResponse teamRemoveMemberWithHttpInfo(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { - Object localVarPostBody = teamRemoveMemberRequest; - - // verify the required parameter 'teamRemoveMemberRequest' is set + // Check required parameters if (teamRemoveMemberRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamRemoveMemberRequest' when calling teamRemoveMember"); } - - // create path and map variables - String localVarPath = "/team/remove_member"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamRemoveMemberRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamRemoveMember", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamRemoveMember", + "/team/remove_member", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamRemoveMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Sub Teams @@ -824,50 +732,43 @@ public ApiResponse teamSubTeamsWithHttpInfo(String teamId, if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'teamId' is set + // Check required parameters if (teamId == null) { throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamSubTeams"); } - - // create path and map variables - String localVarPath = "/team/sub_teams/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/team/sub_teams/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamSubTeams", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamSubTeams", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Team @@ -902,46 +803,32 @@ public TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws Ap */ public ApiResponse teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) throws ApiException { - Object localVarPostBody = teamUpdateRequest; - - // verify the required parameter 'teamUpdateRequest' is set + // Check required parameters if (teamUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); } - - // create path and map variables - String localVarPath = "/team"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamUpdate", + "/team", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : teamUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/TemplateApi.java b/src/main/java/com/dropbox/sign/api/TemplateApi.java index e5ec86d..ab67a5f 100644 --- a/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TemplateApi { private ApiClient apiClient; @@ -94,53 +94,40 @@ public TemplateGetResponse templateAddUser(String templateId, TemplateAddUserReq */ public ApiResponse templateAddUserWithHttpInfo(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - Object localVarPostBody = templateAddUserRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateAddUser"); } - - // verify the required parameter 'templateAddUserRequest' is set if (templateAddUserRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateAddUserRequest' when calling templateAddUser"); } - - // create path and map variables - String localVarPath = "/template/add_user/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/template/add_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateAddUserRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateAddUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateAddUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Template @@ -175,47 +162,33 @@ public TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreat */ public ApiResponse templateCreateWithHttpInfo(TemplateCreateRequest templateCreateRequest) throws ApiException { - Object localVarPostBody = templateCreateRequest; - - // verify the required parameter 'templateCreateRequest' is set + // Check required parameters if (templateCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateCreateRequest' when calling templateCreate"); } - - // create path and map variables - String localVarPath = "/template/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateCreate", + "/template/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Template Draft @@ -250,47 +223,33 @@ public TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft(TemplateC */ public ApiResponse templateCreateEmbeddedDraftWithHttpInfo(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { - Object localVarPostBody = templateCreateEmbeddedDraftRequest; - - // verify the required parameter 'templateCreateEmbeddedDraftRequest' is set + // Check required parameters if (templateCreateEmbeddedDraftRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when calling templateCreateEmbeddedDraft"); } - - // create path and map variables - String localVarPath = "/template/create_embedded_draft"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateCreateEmbeddedDraft", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateCreateEmbeddedDraft", + "/template/create_embedded_draft", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateEmbeddedDraftRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Delete Template @@ -324,46 +283,36 @@ public void templateDelete(String templateId) throws ApiException { */ public ApiResponse templateDeleteWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateDelete"); } - - // create path and map variables - String localVarPath = "/template/delete/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/delete/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("TemplateApi.templateDelete", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "TemplateApi.templateDelete", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Get Template Files @@ -419,49 +368,42 @@ public ApiResponse templateFilesWithHttpInfo(String templateId) throws Api */ public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFiles"); } - - // create path and map variables - String localVarPath = "/template/files/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "file_type", fileType)); - - - - - final String[] localVarAccepts = { - "application/pdf", "application/zip", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/template/files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateFiles", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Template Files as Data Uri @@ -496,48 +438,37 @@ public FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiE */ public ApiResponse templateFilesAsDataUriWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsDataUri"); } - - // create path and map variables - String localVarPath = "/template/files_as_data_uri/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/files_as_data_uri/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateFilesAsDataUri", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Template Files as File Url @@ -596,49 +527,42 @@ public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templ if (forceDownload == null) { forceDownload = 1; } - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsFileUrl"); } - - // create path and map variables - String localVarPath = "/template/files_as_file_url/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "force_download", forceDownload)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/template/files_as_file_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateFilesAsFileUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Template @@ -673,48 +597,37 @@ public TemplateGetResponse templateGet(String templateId) throws ApiException { */ public ApiResponse templateGetWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateGet"); } - - // create path and map variables - String localVarPath = "/template/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Templates @@ -846,46 +759,36 @@ public ApiResponse templateListWithHttpInfo(String account if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/template/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateList", + "/template/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Remove User from Template @@ -922,53 +825,40 @@ public TemplateGetResponse templateRemoveUser(String templateId, TemplateRemoveU */ public ApiResponse templateRemoveUserWithHttpInfo(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { - Object localVarPostBody = templateRemoveUserRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateRemoveUser"); } - - // verify the required parameter 'templateRemoveUserRequest' is set if (templateRemoveUserRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateRemoveUserRequest' when calling templateRemoveUser"); } - - // create path and map variables - String localVarPath = "/template/remove_user/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/template/remove_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateRemoveUserRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateRemoveUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateRemoveUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Template Files @@ -1005,52 +895,39 @@ public TemplateUpdateFilesResponse templateUpdateFiles(String templateId, Templa */ public ApiResponse templateUpdateFilesWithHttpInfo(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { - Object localVarPostBody = templateUpdateFilesRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateUpdateFiles"); } - - // verify the required parameter 'templateUpdateFilesRequest' is set if (templateUpdateFilesRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateUpdateFilesRequest' when calling templateUpdateFiles"); } - - // create path and map variables - String localVarPath = "/template/update_files/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + // Path parameters + String localVarPath = "/template/update_files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateUpdateFilesRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateUpdateFiles", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateUpdateFiles", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateUpdateFilesRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java b/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java index 647482c..b37599a 100644 --- a/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java +++ b/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UnclaimedDraftApi { private ApiClient apiClient; @@ -84,47 +84,33 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreate(UnclaimedDraftCreateReq */ public ApiResponse unclaimedDraftCreateWithHttpInfo(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateRequest; - - // verify the required parameter 'unclaimedDraftCreateRequest' is set + // Check required parameters if (unclaimedDraftCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateRequest' when calling unclaimedDraftCreate"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreate", + "/unclaimed_draft/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Unclaimed Draft @@ -159,47 +145,33 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded(UnclaimedDraftC */ public ApiResponse unclaimedDraftCreateEmbeddedWithHttpInfo(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateEmbeddedRequest; - - // verify the required parameter 'unclaimedDraftCreateEmbeddedRequest' is set + // Check required parameters if (unclaimedDraftCreateEmbeddedRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when calling unclaimedDraftCreateEmbedded"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create_embedded"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreateEmbedded", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbedded", + "/unclaimed_draft/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Unclaimed Draft with Template @@ -234,47 +206,33 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate(Unc */ public ApiResponse unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling unclaimedDraftCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", + "/unclaimed_draft/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Edit and Resend Unclaimed Draft @@ -311,52 +269,39 @@ public UnclaimedDraftCreateResponse unclaimedDraftEditAndResend(String signature */ public ApiResponse unclaimedDraftEditAndResendWithHttpInfo(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftEditAndResendRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling unclaimedDraftEditAndResend"); } - - // verify the required parameter 'unclaimedDraftEditAndResendRequest' is set if (unclaimedDraftEditAndResendRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when calling unclaimedDraftEditAndResend"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftEditAndResendRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftEditAndResend", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftEditAndResend", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftEditAndResendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java b/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java index 15f5dc7..e68272c 100644 --- a/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java +++ b/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java b/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java index c3d4362..3afe97b 100644 --- a/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java +++ b/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java b/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java index 17a335c..8f3273d 100644 --- a/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java +++ b/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java b/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java index ae29f16..759bf81 100644 --- a/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -46,7 +46,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java b/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java index b3c713c..9f12a6e 100644 --- a/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ AccountCreateRequest.JSON_PROPERTY_CLIENT_SECRET, AccountCreateRequest.JSON_PROPERTY_LOCALE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountCreateRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -78,12 +76,11 @@ public AccountCreateRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address which will be associated with the new Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address which will be associated with the new Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public AccountCreateRequest clientId(String clientId) { return this; } - /** + /** * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +126,11 @@ public AccountCreateRequest clientSecret(String clientSecret) { return this; } - /** + /** * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) * @return clientSecret - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public AccountCreateRequest locale(String locale) { return this; } - /** + /** * 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. * @return locale - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java b/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java index b44bd3f..08fd773 100644 --- a/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,8 +42,8 @@ AccountCreateResponse.JSON_PROPERTY_OAUTH_DATA, AccountCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountCreateResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountResponse account; @@ -54,7 +52,7 @@ public class AccountCreateResponse { private OAuthTokenResponse oauthData; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public AccountCreateResponse() { } @@ -79,14 +77,13 @@ public AccountCreateResponse account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public AccountResponse getAccount() { return account; @@ -94,7 +91,7 @@ public AccountResponse getAccount() { @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAccount(AccountResponse account) { this.account = account; } @@ -105,12 +102,11 @@ public AccountCreateResponse oauthData(OAuthTokenResponse oauthData) { return this; } - /** + /** * Get oauthData * @return oauthData - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +135,11 @@ public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountGetResponse.java b/src/main/java/com/dropbox/sign/model/AccountGetResponse.java index 498a5c9..2a2fabc 100644 --- a/src/main/java/com/dropbox/sign/model/AccountGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ AccountGetResponse.JSON_PROPERTY_ACCOUNT, AccountGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountGetResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountResponse account; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public AccountGetResponse() { } @@ -74,14 +72,13 @@ public AccountGetResponse account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public AccountResponse getAccount() { return account; @@ -89,7 +86,7 @@ public AccountResponse getAccount() { @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAccount(AccountResponse account) { this.account = account; } @@ -108,12 +105,11 @@ public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountResponse.java b/src/main/java/com/dropbox/sign/model/AccountResponse.java index 0a327b9..6f431ab 100644 --- a/src/main/java/com/dropbox/sign/model/AccountResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountResponse.java @@ -24,12 +24,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -49,8 +47,8 @@ AccountResponse.JSON_PROPERTY_LOCALE, AccountResponse.JSON_PROPERTY_USAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponse { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -108,12 +106,11 @@ public AccountResponse accountId(String accountId) { return this; } - /** + /** * The ID of the Account * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the Account") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +131,11 @@ public AccountResponse emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +156,11 @@ public AccountResponse isLocked(Boolean isLocked) { return this; } - /** + /** * Returns `true` if the user has been locked out of their account by a team admin. * @return isLocked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has been locked out of their account by a team admin.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +181,11 @@ public AccountResponse isPaidHs(Boolean isPaidHs) { return this; } - /** + /** * Returns `true` if the user has a paid Dropbox Sign account. * @return isPaidHs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -212,12 +206,11 @@ public AccountResponse isPaidHf(Boolean isPaidHf) { return this; } - /** + /** * Returns `true` if the user has a paid HelloFax account. * @return isPaidHf - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid HelloFax account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,12 +231,11 @@ public AccountResponse quotas(AccountResponseQuotas quotas) { return this; } - /** + /** * Get quotas * @return quotas - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUOTAS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -264,12 +256,11 @@ public AccountResponse callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL that Dropbox Sign events will `POST` to. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL that Dropbox Sign events will `POST` to.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,12 +281,11 @@ public AccountResponse roleCode(String roleCode) { return this; } - /** + /** * The membership role for the team. * @return roleCode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The membership role for the team.") @JsonProperty(JSON_PROPERTY_ROLE_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +306,11 @@ public AccountResponse teamId(String teamId) { return this; } - /** + /** * The id of the team account belongs to. * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the team account belongs to.") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,12 +331,11 @@ public AccountResponse locale(String locale) { return this; } - /** + /** * 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. * @return locale - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -368,12 +356,11 @@ public AccountResponse usage(AccountResponseUsage usage) { return this; } - /** + /** * Get usage * @return usage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java b/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java index cd1fcbf..04c1fe7 100644 --- a/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java +++ b/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Details concerning remaining monthly quotas. */ -@ApiModel(description = "Details concerning remaining monthly quotas.") @JsonPropertyOrder({ AccountResponseQuotas.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, AccountResponseQuotas.JSON_PROPERTY_DOCUMENTS_LEFT, @@ -43,8 +40,8 @@ AccountResponseQuotas.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT, AccountResponseQuotas.JSON_PROPERTY_NUM_FAX_PAGES_LEFT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponseQuotas { public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; private Integer apiSignatureRequestsLeft; @@ -87,12 +84,11 @@ public AccountResponseQuotas apiSignatureRequestsLeft(Integer apiSignatureReques return this; } - /** + /** * API signature requests remaining. * @return apiSignatureRequestsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API signature requests remaining.") @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +109,11 @@ public AccountResponseQuotas documentsLeft(Integer documentsLeft) { return this; } - /** + /** * Signature requests remaining. * @return documentsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature requests remaining.") @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +134,11 @@ public AccountResponseQuotas templatesTotal(Integer templatesTotal) { return this; } - /** + /** * Total API templates allowed. * @return templatesTotal - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Total API templates allowed.") @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +159,11 @@ public AccountResponseQuotas templatesLeft(Integer templatesLeft) { return this; } - /** + /** * API templates remaining. * @return templatesLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API templates remaining.") @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +184,11 @@ public AccountResponseQuotas smsVerificationsLeft(Integer smsVerificationsLeft) return this; } - /** + /** * SMS verifications remaining. * @return smsVerificationsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "SMS verifications remaining.") @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +209,11 @@ public AccountResponseQuotas numFaxPagesLeft(Integer numFaxPagesLeft) { return this; } - /** + /** * Number of fax pages left * @return numFaxPagesLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of fax pages left") @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java b/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java index ac1979e..741d5e5 100644 --- a/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java +++ b/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Details concerning monthly usage */ -@ApiModel(description = "Details concerning monthly usage") @JsonPropertyOrder({ AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponseUsage { public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; private Integer faxPagesSent; @@ -67,12 +64,11 @@ public AccountResponseUsage faxPagesSent(Integer faxPagesSent) { return this; } - /** + /** * Number of fax pages sent * @return faxPagesSent - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of fax pages sent") @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java b/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java index 06ffd23..f1bede2 100644 --- a/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ AccountUpdateRequest.JSON_PROPERTY_CALLBACK_URL, AccountUpdateRequest.JSON_PROPERTY_LOCALE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountUpdateRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public AccountUpdateRequest accountId(String accountId) { return this; } - /** + /** * The ID of the Account * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the Account") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public AccountUpdateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL that Dropbox Sign should POST events to. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL that Dropbox Sign should POST events to.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public AccountUpdateRequest locale(String locale) { return this; } - /** + /** * 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. * @return locale - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java b/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java index 579f099..ef7ce84 100644 --- a/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java +++ b/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -66,12 +64,11 @@ public AccountVerifyRequest emailAddress(String emailAddress) { return this; } - /** + /** * Email address to run the verification for. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Email address to run the verification for.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java b/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java index 2f958c7..a703a42 100644 --- a/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ AccountVerifyResponse.JSON_PROPERTY_ACCOUNT, AccountVerifyResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountVerifyResponseAccount account; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public AccountVerifyResponse() { } @@ -74,12 +72,11 @@ public AccountVerifyResponse account(AccountVerifyResponseAccount account) { return this; } - /** + /** * Get account * @return account - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java b/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java index 57e21a6..38b66db 100644 --- a/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java +++ b/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyResponseAccount { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -66,12 +64,11 @@ public AccountVerifyResponseAccount emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java b/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java index 20643b0..2b2cf1c 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -49,8 +47,8 @@ ApiAppCreateRequest.JSON_PROPERTY_OPTIONS, ApiAppCreateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppCreateRequest { public static final String JSON_PROPERTY_DOMAINS = "domains"; private List domains = new ArrayList<>(); @@ -104,12 +102,11 @@ public ApiAppCreateRequest addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain names the ApiApp will be associated with. * @return domains - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The domain names the ApiApp will be associated with.") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -130,12 +127,11 @@ public ApiAppCreateRequest name(String name) { return this; } - /** + /** * The name you want to assign to the ApiApp. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name you want to assign to the ApiApp.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,12 +152,11 @@ public ApiAppCreateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL at which the ApiApp should receive event callbacks. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL at which the ApiApp should receive event callbacks.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +177,11 @@ public ApiAppCreateRequest customLogoFile(File customLogoFile) { return this; } - /** + /** * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * @return customLogoFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -208,12 +202,11 @@ public ApiAppCreateRequest oauth(SubOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +227,11 @@ public ApiAppCreateRequest options(SubOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,12 +252,11 @@ public ApiAppCreateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLab return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java b/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java index 2865068..a2d69e9 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ ApiAppGetResponse.JSON_PROPERTY_API_APP, ApiAppGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppGetResponse { public static final String JSON_PROPERTY_API_APP = "api_app"; private ApiAppResponse apiApp; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public ApiAppGetResponse() { } @@ -74,14 +72,13 @@ public ApiAppGetResponse apiApp(ApiAppResponse apiApp) { return this; } - /** + /** * Get apiApp * @return apiApp - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ApiAppResponse getApiApp() { return apiApp; @@ -89,7 +86,7 @@ public ApiAppResponse getApiApp() { @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setApiApp(ApiAppResponse apiApp) { this.apiApp = apiApp; } @@ -108,12 +105,11 @@ public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java b/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java index 80190dd..7abb536 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ ApiAppListResponse.JSON_PROPERTY_LIST_INFO, ApiAppListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppListResponse { public static final String JSON_PROPERTY_API_APPS = "api_apps"; - private List apiApps; + private List apiApps = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public ApiAppListResponse() { } @@ -87,14 +85,13 @@ public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { return this; } - /** + /** * Contains information about API Apps. * @return apiApps - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains information about API Apps.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getApiApps() { return apiApps; @@ -102,7 +99,7 @@ public List getApiApps() { @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setApiApps(List apiApps) { this.apiApps = apiApps; } @@ -113,14 +110,13 @@ public ApiAppListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppResponse.java b/src/main/java/com/dropbox/sign/model/ApiAppResponse.java index 89559d8..ee5f12e 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponse.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponse.java @@ -28,19 +28,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about an API App. */ -@ApiModel(description = "Contains information about an API App.") @JsonPropertyOrder({ ApiAppResponse.JSON_PROPERTY_CALLBACK_URL, ApiAppResponse.JSON_PROPERTY_CLIENT_ID, @@ -53,8 +50,8 @@ ApiAppResponse.JSON_PROPERTY_OWNER_ACCOUNT, ApiAppResponse.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponse { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -66,7 +63,7 @@ public class ApiAppResponse { private Integer createdAt; public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains; + private List domains = null; public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -109,12 +106,11 @@ public ApiAppResponse callbackUrl(String callbackUrl) { return this; } - /** + /** * The app's callback URL (for events) * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's callback URL (for events)") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,12 +131,11 @@ public ApiAppResponse clientId(String clientId) { return this; } - /** + /** * The app's client id * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's client id") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,12 +156,11 @@ public ApiAppResponse createdAt(Integer createdAt) { return this; } - /** + /** * The time that the app was created * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time that the app was created") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +189,11 @@ public ApiAppResponse addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain name(s) associated with the app * @return domains - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The domain name(s) associated with the app") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +214,11 @@ public ApiAppResponse name(String name) { return this; } - /** + /** * The name of the app * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the app") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +239,11 @@ public ApiAppResponse isApproved(Boolean isApproved) { return this; } - /** + /** * Boolean to indicate if the app has been approved * @return isApproved - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate if the app has been approved") @JsonProperty(JSON_PROPERTY_IS_APPROVED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +264,11 @@ public ApiAppResponse oauth(ApiAppResponseOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +289,11 @@ public ApiAppResponse options(ApiAppResponseOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +314,11 @@ public ApiAppResponse ownerAccount(ApiAppResponseOwnerAccount ownerAccount) { return this; } - /** + /** * Get ownerAccount * @return ownerAccount - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +339,11 @@ public ApiAppResponse whiteLabelingOptions(ApiAppResponseWhiteLabelingOptions wh return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java index c3893a0..b071e40 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java @@ -24,27 +24,24 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An object describing the app's OAuth properties, or null if OAuth is not configured for the app. */ -@ApiModel(description = "An object describing the app's OAuth properties, or null if OAuth is not configured for the app.") @JsonPropertyOrder({ ApiAppResponseOAuth.JSON_PROPERTY_CALLBACK_URL, ApiAppResponseOAuth.JSON_PROPERTY_SECRET, ApiAppResponseOAuth.JSON_PROPERTY_SCOPES, ApiAppResponseOAuth.JSON_PROPERTY_CHARGES_USERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOAuth { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -53,7 +50,7 @@ public class ApiAppResponseOAuth { private String secret; public static final String JSON_PROPERTY_SCOPES = "scopes"; - private List scopes; + private List scopes = null; public static final String JSON_PROPERTY_CHARGES_USERS = "charges_users"; private Boolean chargesUsers; @@ -81,12 +78,11 @@ public ApiAppResponseOAuth callbackUrl(String callbackUrl) { return this; } - /** + /** * The app's OAuth callback URL. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's OAuth callback URL.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,12 +103,11 @@ public ApiAppResponseOAuth secret(String secret) { return this; } - /** + /** * The app's OAuth secret, or null if the app does not belong to user. * @return secret - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's OAuth secret, or null if the app does not belong to user.") @JsonProperty(JSON_PROPERTY_SECRET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -141,12 +136,11 @@ public ApiAppResponseOAuth addScopesItem(String scopesItem) { return this; } - /** + /** * Array of OAuth scopes used by the app. * @return scopes - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Array of OAuth scopes used by the app.") @JsonProperty(JSON_PROPERTY_SCOPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,12 +161,11 @@ public ApiAppResponseOAuth chargesUsers(Boolean chargesUsers) { return this; } - /** + /** * Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. * @return chargesUsers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.") @JsonProperty(JSON_PROPERTY_CHARGES_USERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java index a908c76..2cffd69 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An object with options that override account settings. */ -@ApiModel(description = "An object with options that override account settings.") @JsonPropertyOrder({ ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOptions { public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; private Boolean canInsertEverywhere; @@ -67,12 +64,11 @@ public ApiAppResponseOptions canInsertEverywhere(Boolean canInsertEverywhere) { return this; } - /** + /** * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document * @return canInsertEverywhere - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document") @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java index 8101f36..80f95b5 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An object describing the app's owner */ -@ApiModel(description = "An object describing the app's owner") @JsonPropertyOrder({ ApiAppResponseOwnerAccount.JSON_PROPERTY_ACCOUNT_ID, ApiAppResponseOwnerAccount.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOwnerAccount { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -71,12 +68,11 @@ public ApiAppResponseOwnerAccount accountId(String accountId) { return this; } - /** + /** * The owner account's ID * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The owner account's ID") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public ApiAppResponseOwnerAccount emailAddress(String emailAddress) { return this; } - /** + /** * The owner account's email address * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The owner account's email address") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java index 02de95f..44b6f6e 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An object with options to customize the app's signer page */ -@ApiModel(description = "An object with options to customize the app's signer page") @JsonPropertyOrder({ ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, @@ -51,8 +48,8 @@ ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2 }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseWhiteLabelingOptions { public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; private String headerBackgroundColor; @@ -119,12 +116,11 @@ public ApiAppResponseWhiteLabelingOptions headerBackgroundColor(String headerBac return this; } - /** + /** * Get headerBackgroundColor * @return headerBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -145,12 +141,11 @@ public ApiAppResponseWhiteLabelingOptions legalVersion(String legalVersion) { return this; } - /** + /** * Get legalVersion * @return legalVersion - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -171,12 +166,11 @@ public ApiAppResponseWhiteLabelingOptions linkColor(String linkColor) { return this; } - /** + /** * Get linkColor * @return linkColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LINK_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -197,12 +191,11 @@ public ApiAppResponseWhiteLabelingOptions pageBackgroundColor(String pageBackgro return this; } - /** + /** * Get pageBackgroundColor * @return pageBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,12 +216,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonColor(String primaryButto return this; } - /** + /** * Get primaryButtonColor * @return primaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,12 +241,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover(String primary return this; } - /** + /** * Get primaryButtonColorHover * @return primaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +266,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor(String primaryB return this; } - /** + /** * Get primaryButtonTextColor * @return primaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -301,12 +291,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover(String pri return this; } - /** + /** * Get primaryButtonTextColorHover * @return primaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,12 +316,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonColor(String secondaryB return this; } - /** + /** * Get secondaryButtonColor * @return secondaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -353,12 +341,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover(String secon return this; } - /** + /** * Get secondaryButtonColorHover * @return secondaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -379,12 +366,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor(String second return this; } - /** + /** * Get secondaryButtonTextColor * @return secondaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -405,12 +391,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover(String s return this; } - /** + /** * Get secondaryButtonTextColorHover * @return secondaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -431,12 +416,11 @@ public ApiAppResponseWhiteLabelingOptions textColor1(String textColor1) { return this; } - /** + /** * Get textColor1 * @return textColor1 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -457,12 +441,11 @@ public ApiAppResponseWhiteLabelingOptions textColor2(String textColor2) { return this; } - /** + /** * Get textColor2 * @return textColor2 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java b/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java index 681cbea..c4a4849 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -49,8 +47,8 @@ ApiAppUpdateRequest.JSON_PROPERTY_OPTIONS, ApiAppUpdateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppUpdateRequest { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -59,7 +57,7 @@ public class ApiAppUpdateRequest { private File customLogoFile; public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains; + private List domains = null; public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -96,12 +94,11 @@ public ApiAppUpdateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL at which the API App should receive event callbacks. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL at which the API App should receive event callbacks.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -122,12 +119,11 @@ public ApiAppUpdateRequest customLogoFile(File customLogoFile) { return this; } - /** + /** * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * @return customLogoFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +152,11 @@ public ApiAppUpdateRequest addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain names the ApiApp will be associated with. * @return domains - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The domain names the ApiApp will be associated with.") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +177,11 @@ public ApiAppUpdateRequest name(String name) { return this; } - /** + /** * The name you want to assign to the ApiApp. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name you want to assign to the ApiApp.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -208,12 +202,11 @@ public ApiAppUpdateRequest oauth(SubOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +227,11 @@ public ApiAppUpdateRequest options(SubOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,12 +252,11 @@ public ApiAppUpdateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLab return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java index 5af7a00..af9c337 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -46,8 +44,8 @@ BulkSendJobGetResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, BulkSendJobGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobGetResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; private BulkSendJobResponse bulkSendJob; @@ -56,10 +54,10 @@ public class BulkSendJobGetResponse { private ListInfoResponse listInfo; public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests; + private List signatureRequests = new ArrayList<>(); public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public BulkSendJobGetResponse() { } @@ -84,14 +82,13 @@ public BulkSendJobGetResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { return this; } - /** + /** * Get bulkSendJob * @return bulkSendJob - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public BulkSendJobResponse getBulkSendJob() { return bulkSendJob; @@ -99,7 +96,7 @@ public BulkSendJobResponse getBulkSendJob() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { this.bulkSendJob = bulkSendJob; } @@ -110,14 +107,13 @@ public BulkSendJobGetResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -125,7 +121,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -144,14 +140,13 @@ public BulkSendJobGetResponse addSignatureRequestsItem(BulkSendJobGetResponseSig return this; } - /** + /** * Contains information about the Signature Requests sent in bulk. * @return signatureRequests - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains information about the Signature Requests sent in bulk.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSignatureRequests() { return signatureRequests; @@ -159,7 +154,7 @@ public List getSignatureRequests() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequests(List signatureRequests) { this.signatureRequests = signatureRequests; } @@ -178,12 +173,11 @@ public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java index 5690b49..76c5b31 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -67,8 +65,8 @@ BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURES, BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_BULK_SEND_JOB_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobGetResponseSignatureRequests { public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; private Boolean testMode = false; @@ -119,7 +117,7 @@ public class BulkSendJobGetResponseSignatureRequests { private String detailsUrl; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -128,19 +126,19 @@ public class BulkSendJobGetResponseSignatureRequests { private String finalCopyUri; public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds; + private List templateIds = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - private List responseData; + private List responseData = null; public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - private List signatures; + private List signatures = null; public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -168,12 +166,11 @@ public BulkSendJobGetResponseSignatureRequests testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +191,11 @@ public BulkSendJobGetResponseSignatureRequests signatureRequestId(String signatu return this; } - /** + /** * The id of the SignatureRequest. * @return signatureRequestId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,12 +216,11 @@ public BulkSendJobGetResponseSignatureRequests requesterEmailAddress(String requ return this; } - /** + /** * The email address of the initiator of the SignatureRequest. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the initiator of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,12 +241,11 @@ public BulkSendJobGetResponseSignatureRequests title(String title) { return this; } - /** + /** * The title the specified Account uses for the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title the specified Account uses for the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -272,12 +266,11 @@ public BulkSendJobGetResponseSignatureRequests originalTitle(String originalTitl return this; } - /** + /** * Default Label for account. * @return originalTitle - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Default Label for account.") @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -298,12 +291,11 @@ public BulkSendJobGetResponseSignatureRequests subject(String subject) { return this; } - /** + /** * The subject in the email that was initially sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,12 +316,11 @@ public BulkSendJobGetResponseSignatureRequests message(String message) { return this; } - /** + /** * The custom message in the email that was initially sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,12 +341,11 @@ public BulkSendJobGetResponseSignatureRequests metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the signature request. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the signature request.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +366,11 @@ public BulkSendJobGetResponseSignatureRequests createdAt(Integer createdAt) { return this; } - /** + /** * Time the signature request was created. * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time the signature request was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -402,12 +391,11 @@ public BulkSendJobGetResponseSignatureRequests expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +416,11 @@ public BulkSendJobGetResponseSignatureRequests isComplete(Boolean isComplete) { return this; } - /** + /** * Whether or not the SignatureRequest has been fully executed by all signers. * @return isComplete - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been fully executed by all signers.") @JsonProperty(JSON_PROPERTY_IS_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -454,12 +441,11 @@ public BulkSendJobGetResponseSignatureRequests isDeclined(Boolean isDeclined) { return this; } - /** + /** * Whether or not the SignatureRequest has been declined by a signer. * @return isDeclined - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been declined by a signer.") @JsonProperty(JSON_PROPERTY_IS_DECLINED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -480,12 +466,11 @@ public BulkSendJobGetResponseSignatureRequests hasError(Boolean hasError) { return this; } - /** + /** * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * @return hasError - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") @JsonProperty(JSON_PROPERTY_HAS_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -506,12 +491,11 @@ public BulkSendJobGetResponseSignatureRequests filesUrl(String filesUrl) { return this; } - /** + /** * The URL where a copy of the request's documents can be downloaded. * @return filesUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where a copy of the request's documents can be downloaded.") @JsonProperty(JSON_PROPERTY_FILES_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -532,12 +516,11 @@ public BulkSendJobGetResponseSignatureRequests signingUrl(String signingUrl) { return this; } - /** + /** * 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. * @return signingUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SIGNING_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -558,12 +541,11 @@ public BulkSendJobGetResponseSignatureRequests detailsUrl(String detailsUrl) { return this; } - /** + /** * The URL where the requester and the signers can view the current status of the SignatureRequest. * @return detailsUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where the requester and the signers can view the current status of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_DETAILS_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -592,12 +574,11 @@ public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem(String cc return this; } - /** + /** * 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. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -618,12 +599,11 @@ public BulkSendJobGetResponseSignatureRequests signingRedirectUrl(String signing return this; } - /** + /** * The URL you want the signer redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want the signer redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -644,12 +624,11 @@ public BulkSendJobGetResponseSignatureRequests finalCopyUri(String finalCopyUri) return this; } - /** + /** * The path where the completed document can be downloaded * @return finalCopyUri - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The path where the completed document can be downloaded") @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -678,12 +657,11 @@ public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templat return this; } - /** + /** * Templates IDs used in this SignatureRequest (if any). * @return templateIds - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Templates IDs used in this SignatureRequest (if any).") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -712,12 +690,11 @@ public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem(SignatureRequ return this; } - /** + /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -746,12 +723,11 @@ public BulkSendJobGetResponseSignatureRequests addAttachmentsItem(SignatureReque return this; } - /** + /** * Signer attachments. * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signer attachments.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -780,12 +756,11 @@ public BulkSendJobGetResponseSignatureRequests addResponseDataItem(SignatureRequ return this; } - /** + /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * @return responseData - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -814,12 +789,11 @@ public BulkSendJobGetResponseSignatureRequests addSignaturesItem(SignatureReques return this; } - /** + /** * An array of signature objects, 1 for each signer. * @return signatures - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of signature objects, 1 for each signer.") @JsonProperty(JSON_PROPERTY_SIGNATURES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,12 +814,11 @@ public BulkSendJobGetResponseSignatureRequests bulkSendJobId(String bulkSendJobI return this; } - /** + /** * The id of the BulkSendJob. * @return bulkSendJobId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the BulkSendJob.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java index 7680094..c550b31 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ BulkSendJobListResponse.JSON_PROPERTY_LIST_INFO, BulkSendJobListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobListResponse { public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; - private List bulkSendJobs; + private List bulkSendJobs = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public BulkSendJobListResponse() { } @@ -87,14 +85,13 @@ public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJ return this; } - /** + /** * Contains a list of BulkSendJobs that the API caller has access to. * @return bulkSendJobs - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list of BulkSendJobs that the API caller has access to.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getBulkSendJobs() { return bulkSendJobs; @@ -102,7 +99,7 @@ public List getBulkSendJobs() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJobs(List bulkSendJobs) { this.bulkSendJobs = bulkSendJobs; } @@ -113,14 +110,13 @@ public BulkSendJobListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java index 7c96eb8..88f0eec 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. */ -@ApiModel(description = "Contains information about the BulkSendJob such as when it was created and how many signature requests are queued.") @JsonPropertyOrder({ BulkSendJobResponse.JSON_PROPERTY_BULK_SEND_JOB_ID, BulkSendJobResponse.JSON_PROPERTY_TOTAL, BulkSendJobResponse.JSON_PROPERTY_IS_CREATOR, BulkSendJobResponse.JSON_PROPERTY_CREATED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -79,12 +76,11 @@ public BulkSendJobResponse bulkSendJobId(String bulkSendJobId) { return this; } - /** + /** * The id of the BulkSendJob. * @return bulkSendJobId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the BulkSendJob.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public BulkSendJobResponse total(Integer total) { return this; } - /** + /** * The total amount of Signature Requests queued for sending. * @return total - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The total amount of Signature Requests queued for sending.") @JsonProperty(JSON_PROPERTY_TOTAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public BulkSendJobResponse isCreator(Boolean isCreator) { return this; } - /** + /** * True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. * @return isCreator - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.") @JsonProperty(JSON_PROPERTY_IS_CREATOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public BulkSendJobResponse createdAt(Integer createdAt) { return this; } - /** + /** * Time that the BulkSendJob was created. * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time that the BulkSendJob was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java index 2484922..b3be772 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ BulkSendJobSendResponse.JSON_PROPERTY_BULK_SEND_JOB, BulkSendJobSendResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobSendResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; private BulkSendJobResponse bulkSendJob; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public BulkSendJobSendResponse() { } @@ -74,14 +72,13 @@ public BulkSendJobSendResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { return this; } - /** + /** * Get bulkSendJob * @return bulkSendJob - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public BulkSendJobResponse getBulkSendJob() { return bulkSendJob; @@ -89,7 +86,7 @@ public BulkSendJobResponse getBulkSendJob() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { this.bulkSendJob = bulkSendJob; } @@ -108,12 +105,11 @@ public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java index ec213e9..103eb03 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -50,14 +48,14 @@ EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, EmbeddedEditUrlRequest.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlRequest { public static final String JSON_PROPERTY_ALLOW_EDIT_CCS = "allow_edit_ccs"; private Boolean allowEditCcs = false; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -69,7 +67,7 @@ public class EmbeddedEditUrlRequest { private Boolean forceSubjectMessage = false; public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields; + private List mergeFields = null; public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; private Boolean previewOnly = false; @@ -106,12 +104,11 @@ public EmbeddedEditUrlRequest allowEditCcs(Boolean allowEditCcs) { return this; } - /** + /** * This allows the requester to enable/disable to add or change CC roles when editing the template. * @return allowEditCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable/disable to add or change CC roles when editing the template.") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,12 +137,11 @@ public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * 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. * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,12 +162,11 @@ public EmbeddedEditUrlRequest editorOptions(SubEditorOptions editorOptions) { return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -192,12 +187,11 @@ public EmbeddedEditUrlRequest forceSignerRoles(Boolean forceSignerRoles) { return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,12 +212,11 @@ public EmbeddedEditUrlRequest forceSubjectMessage(Boolean forceSubjectMessage) { return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -252,12 +245,11 @@ public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) return this; } - /** + /** * 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 `[]`. * @return mergeFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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 `[]`.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,12 +270,11 @@ public EmbeddedEditUrlRequest previewOnly(Boolean previewOnly) { return this; } - /** + /** * 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). * @return previewOnly - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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).") @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -304,12 +295,11 @@ public EmbeddedEditUrlRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -330,12 +320,11 @@ public EmbeddedEditUrlRequest showProgressStepper(Boolean showProgressStepper) { return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -356,12 +345,11 @@ public EmbeddedEditUrlRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java index 0002110..cf7faf9 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ EmbeddedEditUrlResponse.JSON_PROPERTY_EMBEDDED, EmbeddedEditUrlResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlResponse { public static final String JSON_PROPERTY_EMBEDDED = "embedded"; private EmbeddedEditUrlResponseEmbedded embedded; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public EmbeddedEditUrlResponse() { } @@ -74,14 +72,13 @@ public EmbeddedEditUrlResponse embedded(EmbeddedEditUrlResponseEmbedded embedded return this; } - /** + /** * Get embedded * @return embedded - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public EmbeddedEditUrlResponseEmbedded getEmbedded() { return embedded; @@ -89,7 +86,7 @@ public EmbeddedEditUrlResponseEmbedded getEmbedded() { @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEmbedded(EmbeddedEditUrlResponseEmbedded embedded) { this.embedded = embedded; } @@ -108,12 +105,11 @@ public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java index b14b255..c990405 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An embedded template object. */ -@ApiModel(description = "An embedded template object.") @JsonPropertyOrder({ EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL, EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlResponseEmbedded { public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; private String editUrl; @@ -71,12 +68,11 @@ public EmbeddedEditUrlResponseEmbedded editUrl(String editUrl) { return this; } - /** + /** * A template url that can be opened in an iFrame. * @return editUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A template url that can be opened in an iFrame.") @JsonProperty(JSON_PROPERTY_EDIT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public EmbeddedEditUrlResponseEmbedded expiresAt(Integer expiresAt) { return this; } - /** + /** * The specific time that the the `edit_url` link expires, in epoch. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The specific time that the the `edit_url` link expires, in epoch.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java index a15b37d..3455fe0 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ EmbeddedSignUrlResponse.JSON_PROPERTY_EMBEDDED, EmbeddedSignUrlResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedSignUrlResponse { public static final String JSON_PROPERTY_EMBEDDED = "embedded"; private EmbeddedSignUrlResponseEmbedded embedded; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public EmbeddedSignUrlResponse() { } @@ -74,14 +72,13 @@ public EmbeddedSignUrlResponse embedded(EmbeddedSignUrlResponseEmbedded embedded return this; } - /** + /** * Get embedded * @return embedded - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public EmbeddedSignUrlResponseEmbedded getEmbedded() { return embedded; @@ -89,7 +86,7 @@ public EmbeddedSignUrlResponseEmbedded getEmbedded() { @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEmbedded(EmbeddedSignUrlResponseEmbedded embedded) { this.embedded = embedded; } @@ -108,12 +105,11 @@ public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java index a9af850..f88dd63 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An object that contains necessary information to set up embedded signing. */ -@ApiModel(description = "An object that contains necessary information to set up embedded signing.") @JsonPropertyOrder({ EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_SIGN_URL, EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedSignUrlResponseEmbedded { public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; private String signUrl; @@ -71,12 +68,11 @@ public EmbeddedSignUrlResponseEmbedded signUrl(String signUrl) { return this; } - /** + /** * A signature url that can be opened in an iFrame. * @return signUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A signature url that can be opened in an iFrame.") @JsonProperty(JSON_PROPERTY_SIGN_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public EmbeddedSignUrlResponseEmbedded expiresAt(Integer expiresAt) { return this; } - /** + /** * The specific time that the the `sign_url` link expires, in epoch. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The specific time that the the `sign_url` link expires, in epoch.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ErrorResponse.java b/src/main/java/com/dropbox/sign/model/ErrorResponse.java index 1441520..ea26e45 100644 --- a/src/main/java/com/dropbox/sign/model/ErrorResponse.java +++ b/src/main/java/com/dropbox/sign/model/ErrorResponse.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ @JsonPropertyOrder({ ErrorResponse.JSON_PROPERTY_ERROR }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponse { public static final String JSON_PROPERTY_ERROR = "error"; private ErrorResponseError error; @@ -67,12 +65,11 @@ public ErrorResponse error(ErrorResponseError error) { return this; } - /** + /** * Get error * @return error - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_ERROR) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/ErrorResponseError.java b/src/main/java/com/dropbox/sign/model/ErrorResponseError.java index fadf272..2c72770 100644 --- a/src/main/java/com/dropbox/sign/model/ErrorResponseError.java +++ b/src/main/java/com/dropbox/sign/model/ErrorResponseError.java @@ -22,26 +22,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about an error that occurred. */ -@ApiModel(description = "Contains information about an error that occurred.") @JsonPropertyOrder({ ErrorResponseError.JSON_PROPERTY_ERROR_MSG, ErrorResponseError.JSON_PROPERTY_ERROR_NAME, ErrorResponseError.JSON_PROPERTY_ERROR_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponseError { public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; private String errorMsg; @@ -75,12 +72,11 @@ public ErrorResponseError errorMsg(String errorMsg) { return this; } - /** + /** * Message describing an error. * @return errorMsg - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Message describing an error.") @JsonProperty(JSON_PROPERTY_ERROR_MSG) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -101,12 +97,11 @@ public ErrorResponseError errorName(String errorName) { return this; } - /** + /** * Name of the error. * @return errorName - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the error.") @JsonProperty(JSON_PROPERTY_ERROR_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -127,12 +122,11 @@ public ErrorResponseError errorPath(String errorPath) { return this; } - /** + /** * Path at which an error occurred. * @return errorPath - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Path at which an error occurred.") @JsonProperty(JSON_PROPERTY_ERROR_PATH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java index 3208b46..0307d55 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,8 +42,8 @@ EventCallbackRequest.JSON_PROPERTY_SIGNATURE_REQUEST, EventCallbackRequest.JSON_PROPERTY_TEMPLATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequest { public static final String JSON_PROPERTY_EVENT = "event"; private EventCallbackRequestEvent event; @@ -82,12 +80,11 @@ public EventCallbackRequest event(EventCallbackRequestEvent event) { return this; } - /** + /** * Get event * @return event - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_EVENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public EventCallbackRequest account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public EventCallbackRequest signatureRequest(SignatureRequestResponse signatureR return this; } - /** + /** * Get signatureRequest * @return signatureRequest - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +155,11 @@ public EventCallbackRequest template(TemplateResponse template) { return this; } - /** + /** * Get template * @return template - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEMPLATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java index c8d5e7c..583482a 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java @@ -23,27 +23,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Basic information about the event that occurred. */ -@ApiModel(description = "Basic information about the event that occurred.") @JsonPropertyOrder({ EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TIME, EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TYPE, EventCallbackRequestEvent.JSON_PROPERTY_EVENT_HASH, EventCallbackRequestEvent.JSON_PROPERTY_EVENT_METADATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequestEvent { public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; private String eventTime; @@ -157,12 +154,11 @@ public EventCallbackRequestEvent eventTime(String eventTime) { return this; } - /** + /** * Time the event was created (using Unix time). * @return eventTime - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Time the event was created (using Unix time).") @JsonProperty(JSON_PROPERTY_EVENT_TIME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -183,12 +179,11 @@ public EventCallbackRequestEvent eventType(EventTypeEnum eventType) { return this; } - /** + /** * Type of callback event that was triggered. * @return eventType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type of callback event that was triggered.") @JsonProperty(JSON_PROPERTY_EVENT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +204,11 @@ public EventCallbackRequestEvent eventHash(String eventHash) { return this; } - /** + /** * Generated hash used to verify source of event data. * @return eventHash - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Generated hash used to verify source of event data.") @JsonProperty(JSON_PROPERTY_EVENT_HASH) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -235,12 +229,11 @@ public EventCallbackRequestEvent eventMetadata(EventCallbackRequestEventMetadata return this; } - /** + /** * Get eventMetadata * @return eventMetadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EVENT_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java index f0bea06..b832ff1 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Specific metadata about the event. */ -@ApiModel(description = "Specific metadata about the event.") @JsonPropertyOrder({ EventCallbackRequestEventMetadata.JSON_PROPERTY_RELATED_SIGNATURE_ID, EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID, EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_APP_ID, EventCallbackRequestEventMetadata.JSON_PROPERTY_EVENT_MESSAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequestEventMetadata { public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; private String relatedSignatureId; @@ -79,12 +76,11 @@ public EventCallbackRequestEventMetadata relatedSignatureId(String relatedSignat return this; } - /** + /** * Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. * @return relatedSignatureId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.") @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public EventCallbackRequestEventMetadata reportedForAccountId(String reportedFor return this; } - /** + /** * Account ID the event was reported for. * @return reportedForAccountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Account ID the event was reported for.") @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public EventCallbackRequestEventMetadata reportedForAppId(String reportedForAppI return this; } - /** + /** * App ID the event was reported for. * @return reportedForAppId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "App ID the event was reported for.") @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public EventCallbackRequestEventMetadata eventMessage(String eventMessage) { return this; } - /** + /** * Message about a declined or failed (due to error) signature flow. * @return eventMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Message about a declined or failed (due to error) signature flow.") @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java new file mode 100644 index 0000000..99f972a --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java @@ -0,0 +1,278 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineAddUserRequest + */ +@JsonPropertyOrder({ + FaxLineAddUserRequest.JSON_PROPERTY_NUMBER, + FaxLineAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAddUserRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public FaxLineAddUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAddUserRequest.class); + } + + static public FaxLineAddUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAddUserRequest.class + ); + } + + public FaxLineAddUserRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineAddUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public FaxLineAddUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineAddUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAddUserRequest faxLineAddUserRequest = (FaxLineAddUserRequest) o; + return Objects.equals(this.number, faxLineAddUserRequest.number) && + Objects.equals(this.accountId, faxLineAddUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineAddUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAddUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } + + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java new file mode 100644 index 0000000..d6ef808 --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java @@ -0,0 +1,65 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetCountryEnum + */ +public enum FaxLineAreaCodeGetCountryEnum { + + CA("CA"), + + US("US"), + + UK("UK"); + + private String value; + + FaxLineAreaCodeGetCountryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetCountryEnum fromValue(String value) { + for (FaxLineAreaCodeGetCountryEnum b : FaxLineAreaCodeGetCountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java new file mode 100644 index 0000000..3c0b913 --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java @@ -0,0 +1,85 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetProvinceEnum + */ +public enum FaxLineAreaCodeGetProvinceEnum { + + AB("AB"), + + BC("BC"), + + MB("MB"), + + NB("NB"), + + NL("NL"), + + NT("NT"), + + NS("NS"), + + NU("NU"), + + ON("ON"), + + PE("PE"), + + QC("QC"), + + SK("SK"), + + YT("YT"); + + private String value; + + FaxLineAreaCodeGetProvinceEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetProvinceEnum fromValue(String value) { + for (FaxLineAreaCodeGetProvinceEnum b : FaxLineAreaCodeGetProvinceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java new file mode 100644 index 0000000..b4b2bbb --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java @@ -0,0 +1,188 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineAreaCodeGetResponse + */ +@JsonPropertyOrder({ + FaxLineAreaCodeGetResponse.JSON_PROPERTY_AREA_CODES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAreaCodeGetResponse { + public static final String JSON_PROPERTY_AREA_CODES = "area_codes"; + private List areaCodes = new ArrayList<>(); + + public FaxLineAreaCodeGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAreaCodeGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAreaCodeGetResponse.class); + } + + static public FaxLineAreaCodeGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAreaCodeGetResponse.class + ); + } + + public FaxLineAreaCodeGetResponse areaCodes(List areaCodes) { + this.areaCodes = areaCodes; + return this; + } + + public FaxLineAreaCodeGetResponse addAreaCodesItem(Integer areaCodesItem) { + if (this.areaCodes == null) { + this.areaCodes = new ArrayList<>(); + } + this.areaCodes.add(areaCodesItem); + return this; + } + + /** + * Get areaCodes + * @return areaCodes + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAreaCodes() { + return areaCodes; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCodes(List areaCodes) { + this.areaCodes = areaCodes; + } + + + /** + * Return true if this FaxLineAreaCodeGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAreaCodeGetResponse faxLineAreaCodeGetResponse = (FaxLineAreaCodeGetResponse) o; + return Objects.equals(this.areaCodes, faxLineAreaCodeGetResponse.areaCodes); + } + + @Override + public int hashCode() { + return Objects.hash(areaCodes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAreaCodeGetResponse {\n"); + sb.append(" areaCodes: ").append(toIndentedString(areaCodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCodes != null) { + if (isFileTypeOrListOfFiles(areaCodes)) { + fileTypeFound = true; + } + + if (areaCodes.getClass().equals(java.io.File.class) || + areaCodes.getClass().equals(Integer.class) || + areaCodes.getClass().equals(String.class) || + areaCodes.getClass().isEnum()) { + map.put("area_codes", areaCodes); + } else if (isListOfFile(areaCodes)) { + for(int i = 0; i< getListSize(areaCodes); i++) { + map.put("area_codes[" + i + "]", getFromList(areaCodes, i)); + } + } + else { + map.put("area_codes", JSON.getDefault().getMapper().writeValueAsString(areaCodes)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java new file mode 100644 index 0000000..c0e5ae4 --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java @@ -0,0 +1,161 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetStateEnum + */ +public enum FaxLineAreaCodeGetStateEnum { + + AK("AK"), + + AL("AL"), + + AR("AR"), + + AZ("AZ"), + + CA("CA"), + + CO("CO"), + + CT("CT"), + + DC("DC"), + + DE("DE"), + + FL("FL"), + + GA("GA"), + + HI("HI"), + + IA("IA"), + + ID("ID"), + + IL("IL"), + + IN("IN"), + + KS("KS"), + + KY("KY"), + + LA("LA"), + + MA("MA"), + + MD("MD"), + + ME("ME"), + + MI("MI"), + + MN("MN"), + + MO("MO"), + + MS("MS"), + + MT("MT"), + + NC("NC"), + + ND("ND"), + + NE("NE"), + + NH("NH"), + + NJ("NJ"), + + NM("NM"), + + NV("NV"), + + NY("NY"), + + OH("OH"), + + OK("OK"), + + OR("OR"), + + PA("PA"), + + RI("RI"), + + SC("SC"), + + SD("SD"), + + TN("TN"), + + TX("TX"), + + UT("UT"), + + VA("VA"), + + VT("VT"), + + WA("WA"), + + WI("WI"), + + WV("WV"), + + WY("WY"); + + private String value; + + FaxLineAreaCodeGetStateEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetStateEnum fromValue(String value) { + for (FaxLineAreaCodeGetStateEnum b : FaxLineAreaCodeGetStateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java new file mode 100644 index 0000000..7d23eac --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java @@ -0,0 +1,365 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineCreateRequest + */ +@JsonPropertyOrder({ + FaxLineCreateRequest.JSON_PROPERTY_AREA_CODE, + FaxLineCreateRequest.JSON_PROPERTY_COUNTRY, + FaxLineCreateRequest.JSON_PROPERTY_CITY, + FaxLineCreateRequest.JSON_PROPERTY_ACCOUNT_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineCreateRequest { + public static final String JSON_PROPERTY_AREA_CODE = "area_code"; + private Integer areaCode; + + /** + * Country + */ + public enum CountryEnum { + CA("CA"), + + US("US"), + + UK("UK"); + + private String value; + + CountryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CountryEnum fromValue(String value) { + for (CountryEnum b : CountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private CountryEnum country; + + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public FaxLineCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineCreateRequest.class); + } + + static public FaxLineCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineCreateRequest.class + ); + } + + public FaxLineCreateRequest areaCode(Integer areaCode) { + this.areaCode = areaCode; + return this; + } + + /** + * Area code + * @return areaCode + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getAreaCode() { + return areaCode; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCode(Integer areaCode) { + this.areaCode = areaCode; + } + + + public FaxLineCreateRequest country(CountryEnum country) { + this.country = country; + return this; + } + + /** + * Country + * @return country + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CountryEnum getCountry() { + return country; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCountry(CountryEnum country) { + this.country = country; + } + + + public FaxLineCreateRequest city(String city) { + this.city = city; + return this; + } + + /** + * City + * @return city + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCity() { + return city; + } + + + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + + public FaxLineCreateRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + /** + * Return true if this FaxLineCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineCreateRequest faxLineCreateRequest = (FaxLineCreateRequest) o; + return Objects.equals(this.areaCode, faxLineCreateRequest.areaCode) && + Objects.equals(this.country, faxLineCreateRequest.country) && + Objects.equals(this.city, faxLineCreateRequest.city) && + Objects.equals(this.accountId, faxLineCreateRequest.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(areaCode, country, city, accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineCreateRequest {\n"); + sb.append(" areaCode: ").append(toIndentedString(areaCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCode != null) { + if (isFileTypeOrListOfFiles(areaCode)) { + fileTypeFound = true; + } + + if (areaCode.getClass().equals(java.io.File.class) || + areaCode.getClass().equals(Integer.class) || + areaCode.getClass().equals(String.class) || + areaCode.getClass().isEnum()) { + map.put("area_code", areaCode); + } else if (isListOfFile(areaCode)) { + for(int i = 0; i< getListSize(areaCode); i++) { + map.put("area_code[" + i + "]", getFromList(areaCode, i)); + } + } + else { + map.put("area_code", JSON.getDefault().getMapper().writeValueAsString(areaCode)); + } + } + if (country != null) { + if (isFileTypeOrListOfFiles(country)) { + fileTypeFound = true; + } + + if (country.getClass().equals(java.io.File.class) || + country.getClass().equals(Integer.class) || + country.getClass().equals(String.class) || + country.getClass().isEnum()) { + map.put("country", country); + } else if (isListOfFile(country)) { + for(int i = 0; i< getListSize(country); i++) { + map.put("country[" + i + "]", getFromList(country, i)); + } + } + else { + map.put("country", JSON.getDefault().getMapper().writeValueAsString(country)); + } + } + if (city != null) { + if (isFileTypeOrListOfFiles(city)) { + fileTypeFound = true; + } + + if (city.getClass().equals(java.io.File.class) || + city.getClass().equals(Integer.class) || + city.getClass().equals(String.class) || + city.getClass().isEnum()) { + map.put("city", city); + } else if (isListOfFile(city)) { + for(int i = 0; i< getListSize(city); i++) { + map.put("city[" + i + "]", getFromList(city, i)); + } + } + else { + map.put("city", JSON.getDefault().getMapper().writeValueAsString(city)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java new file mode 100644 index 0000000..c7876dd --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java @@ -0,0 +1,178 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineDeleteRequest + */ +@JsonPropertyOrder({ + FaxLineDeleteRequest.JSON_PROPERTY_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineDeleteRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public FaxLineDeleteRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineDeleteRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineDeleteRequest.class); + } + + static public FaxLineDeleteRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineDeleteRequest.class + ); + } + + public FaxLineDeleteRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + /** + * Return true if this FaxLineDeleteRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineDeleteRequest faxLineDeleteRequest = (FaxLineDeleteRequest) o; + return Objects.equals(this.number, faxLineDeleteRequest.number); + } + + @Override + public int hashCode() { + return Objects.hash(number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineDeleteRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java b/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java new file mode 100644 index 0000000..33163a2 --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java @@ -0,0 +1,291 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxLineResponseFaxLine; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineListResponse + */ +@JsonPropertyOrder({ + FaxLineListResponse.JSON_PROPERTY_LIST_INFO, + FaxLineListResponse.JSON_PROPERTY_FAX_LINES, + FaxLineListResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineListResponse { + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_FAX_LINES = "fax_lines"; + private List faxLines = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxLineListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineListResponse.class); + } + + static public FaxLineListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineListResponse.class + ); + } + + public FaxLineListResponse listInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public FaxLineListResponse faxLines(List faxLines) { + this.faxLines = faxLines; + return this; + } + + public FaxLineListResponse addFaxLinesItem(FaxLineResponseFaxLine faxLinesItem) { + if (this.faxLines == null) { + this.faxLines = new ArrayList<>(); + } + this.faxLines.add(faxLinesItem); + return this; + } + + /** + * Get faxLines + * @return faxLines + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFaxLines() { + return faxLines; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLines(List faxLines) { + this.faxLines = faxLines; + } + + + public FaxLineListResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineListResponse faxLineListResponse = (FaxLineListResponse) o; + return Objects.equals(this.listInfo, faxLineListResponse.listInfo) && + Objects.equals(this.faxLines, faxLineListResponse.faxLines) && + Objects.equals(this.warnings, faxLineListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(listInfo, faxLines, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineListResponse {\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" faxLines: ").append(toIndentedString(faxLines)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } + + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } + } + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); + } + } + if (faxLines != null) { + if (isFileTypeOrListOfFiles(faxLines)) { + fileTypeFound = true; + } + + if (faxLines.getClass().equals(java.io.File.class) || + faxLines.getClass().equals(Integer.class) || + faxLines.getClass().equals(String.class) || + faxLines.getClass().isEnum()) { + map.put("fax_lines", faxLines); + } else if (isListOfFile(faxLines)) { + for(int i = 0; i< getListSize(faxLines); i++) { + map.put("fax_lines[" + i + "]", getFromList(faxLines, i)); + } + } + else { + map.put("fax_lines", JSON.getDefault().getMapper().writeValueAsString(faxLines)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java new file mode 100644 index 0000000..747853a --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java @@ -0,0 +1,278 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineRemoveUserRequest + */ +@JsonPropertyOrder({ + FaxLineRemoveUserRequest.JSON_PROPERTY_NUMBER, + FaxLineRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineRemoveUserRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public FaxLineRemoveUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineRemoveUserRequest.class); + } + + static public FaxLineRemoveUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineRemoveUserRequest.class + ); + } + + public FaxLineRemoveUserRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineRemoveUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public FaxLineRemoveUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineRemoveUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineRemoveUserRequest faxLineRemoveUserRequest = (FaxLineRemoveUserRequest) o; + return Objects.equals(this.number, faxLineRemoveUserRequest.number) && + Objects.equals(this.accountId, faxLineRemoveUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineRemoveUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineRemoveUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } + + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineResponse.java b/src/main/java/com/dropbox/sign/model/FaxLineResponse.java new file mode 100644 index 0000000..8fae8ca --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineResponse.java @@ -0,0 +1,230 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxLineResponseFaxLine; +import com.dropbox.sign.model.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineResponse + */ +@JsonPropertyOrder({ + FaxLineResponse.JSON_PROPERTY_FAX_LINE, + FaxLineResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponse { + public static final String JSON_PROPERTY_FAX_LINE = "fax_line"; + private FaxLineResponseFaxLine faxLine; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxLineResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponse.class); + } + + static public FaxLineResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponse.class + ); + } + + public FaxLineResponse faxLine(FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + return this; + } + + /** + * Get faxLine + * @return faxLine + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxLineResponseFaxLine getFaxLine() { + return faxLine; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLine(FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + } + + + public FaxLineResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponse faxLineResponse = (FaxLineResponse) o; + return Objects.equals(this.faxLine, faxLineResponse.faxLine) && + Objects.equals(this.warnings, faxLineResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(faxLine, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponse {\n"); + sb.append(" faxLine: ").append(toIndentedString(faxLine)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxLine != null) { + if (isFileTypeOrListOfFiles(faxLine)) { + fileTypeFound = true; + } + + if (faxLine.getClass().equals(java.io.File.class) || + faxLine.getClass().equals(Integer.class) || + faxLine.getClass().equals(String.class) || + faxLine.getClass().isEnum()) { + map.put("fax_line", faxLine); + } else if (isListOfFile(faxLine)) { + for(int i = 0; i< getListSize(faxLine); i++) { + map.put("fax_line[" + i + "]", getFromList(faxLine, i)); + } + } + else { + map.put("fax_line", JSON.getDefault().getMapper().writeValueAsString(faxLine)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java b/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java new file mode 100644 index 0000000..9b6b8c8 --- /dev/null +++ b/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java @@ -0,0 +1,339 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineResponseFaxLine + */ +@JsonPropertyOrder({ + FaxLineResponseFaxLine.JSON_PROPERTY_NUMBER, + FaxLineResponseFaxLine.JSON_PROPERTY_CREATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_UPDATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_ACCOUNTS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponseFaxLine { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Integer updatedAt; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; + + public FaxLineResponseFaxLine() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponseFaxLine init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponseFaxLine.class); + } + + static public FaxLineResponseFaxLine init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponseFaxLine.class + ); + } + + public FaxLineResponseFaxLine number(String number) { + this.number = number; + return this; + } + + /** + * Number + * @return number + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineResponseFaxLine createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Created at + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxLineResponseFaxLine updatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Updated at + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + } + + + public FaxLineResponseFaxLine accounts(List accounts) { + this.accounts = accounts; + return this; + } + + public FaxLineResponseFaxLine addAccountsItem(AccountResponse accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + return this; + } + + /** + * Get accounts + * @return accounts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccounts() { + return accounts; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(List accounts) { + this.accounts = accounts; + } + + + /** + * Return true if this FaxLineResponseFaxLine object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponseFaxLine faxLineResponseFaxLine = (FaxLineResponseFaxLine) o; + return Objects.equals(this.number, faxLineResponseFaxLine.number) && + Objects.equals(this.createdAt, faxLineResponseFaxLine.createdAt) && + Objects.equals(this.updatedAt, faxLineResponseFaxLine.updatedAt) && + Objects.equals(this.accounts, faxLineResponseFaxLine.accounts); + } + + @Override + public int hashCode() { + return Objects.hash(number, createdAt, updatedAt, accounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponseFaxLine {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } + + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } + } + if (updatedAt != null) { + if (isFileTypeOrListOfFiles(updatedAt)) { + fileTypeFound = true; + } + + if (updatedAt.getClass().equals(java.io.File.class) || + updatedAt.getClass().equals(Integer.class) || + updatedAt.getClass().equals(String.class) || + updatedAt.getClass().isEnum()) { + map.put("updated_at", updatedAt); + } else if (isListOfFile(updatedAt)) { + for(int i = 0; i< getListSize(updatedAt); i++) { + map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); + } + } + else { + map.put("updated_at", JSON.getDefault().getMapper().writeValueAsString(updatedAt)); + } + } + if (accounts != null) { + if (isFileTypeOrListOfFiles(accounts)) { + fileTypeFound = true; + } + + if (accounts.getClass().equals(java.io.File.class) || + accounts.getClass().equals(Integer.class) || + accounts.getClass().equals(String.class) || + accounts.getClass().isEnum()) { + map.put("accounts", accounts); + } else if (isListOfFile(accounts)) { + for(int i = 0; i< getListSize(accounts); i++) { + map.put("accounts[" + i + "]", getFromList(accounts, i)); + } + } + else { + map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/dropbox/sign/model/FileResponse.java b/src/main/java/com/dropbox/sign/model/FileResponse.java index 1c779e9..01908c9 100644 --- a/src/main/java/com/dropbox/sign/model/FileResponse.java +++ b/src/main/java/com/dropbox/sign/model/FileResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ FileResponse.JSON_PROPERTY_FILE_URL, FileResponse.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileResponse { public static final String JSON_PROPERTY_FILE_URL = "file_url"; private String fileUrl; @@ -70,14 +68,13 @@ public FileResponse fileUrl(String fileUrl) { return this; } - /** + /** * URL to the file. * @return fileUrl - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "URL to the file.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFileUrl() { return fileUrl; @@ -85,7 +82,7 @@ public String getFileUrl() { @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } @@ -96,14 +93,13 @@ public FileResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * When the link expires. * @return expiresAt - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getExpiresAt() { return expiresAt; @@ -111,7 +107,7 @@ public Integer getExpiresAt() { @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setExpiresAt(Integer expiresAt) { this.expiresAt = expiresAt; } diff --git a/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java b/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java index 9a59056..1ef6cdb 100644 --- a/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java +++ b/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ FileResponseDataUri.JSON_PROPERTY_DATA_URI }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileResponseDataUri { public static final String JSON_PROPERTY_DATA_URI = "data_uri"; private String dataUri; @@ -66,14 +64,13 @@ public FileResponseDataUri dataUri(String dataUri) { return this; } - /** + /** * File as base64 encoded string. * @return dataUri - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "File as base64 encoded string.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getDataUri() { return dataUri; @@ -81,7 +78,7 @@ public String getDataUri() { @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setDataUri(String dataUri) { this.dataUri = dataUri; } diff --git a/src/main/java/com/dropbox/sign/model/ListInfoResponse.java b/src/main/java/com/dropbox/sign/model/ListInfoResponse.java index 9e5a3ca..5a8e00c 100644 --- a/src/main/java/com/dropbox/sign/model/ListInfoResponse.java +++ b/src/main/java/com/dropbox/sign/model/ListInfoResponse.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains pagination information about the data returned. */ -@ApiModel(description = "Contains pagination information about the data returned.") @JsonPropertyOrder({ ListInfoResponse.JSON_PROPERTY_NUM_PAGES, ListInfoResponse.JSON_PROPERTY_NUM_RESULTS, ListInfoResponse.JSON_PROPERTY_PAGE, ListInfoResponse.JSON_PROPERTY_PAGE_SIZE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ListInfoResponse { public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; private Integer numPages; @@ -79,12 +76,11 @@ public ListInfoResponse numPages(Integer numPages) { return this; } - /** + /** * Total number of pages available. * @return numPages - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Total number of pages available.") @JsonProperty(JSON_PROPERTY_NUM_PAGES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public ListInfoResponse numResults(Integer numResults) { return this; } - /** + /** * Total number of objects available. * @return numResults - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Total number of objects available.") @JsonProperty(JSON_PROPERTY_NUM_RESULTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public ListInfoResponse page(Integer page) { return this; } - /** + /** * Number of the page being returned. * @return page - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of the page being returned.") @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public ListInfoResponse pageSize(Integer pageSize) { return this; } - /** + /** * Objects returned per page. * @return pageSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Objects returned per page.") @JsonProperty(JSON_PROPERTY_PAGE_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java b/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java index 1c4c9ad..176c0ee 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ OAuthTokenGenerateRequest.JSON_PROPERTY_GRANT_TYPE, OAuthTokenGenerateRequest.JSON_PROPERTY_STATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenGenerateRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -82,12 +80,11 @@ public OAuthTokenGenerateRequest clientId(String clientId) { return this; } - /** + /** * The client id of the app requesting authorization. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The client id of the app requesting authorization.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public OAuthTokenGenerateRequest clientSecret(String clientSecret) { return this; } - /** + /** * The secret token of your app. * @return clientSecret - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The secret token of your app.") @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -134,12 +130,11 @@ public OAuthTokenGenerateRequest code(String code) { return this; } - /** + /** * The code passed to your callback when the user granted access. * @return code - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The code passed to your callback when the user granted access.") @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -160,12 +155,11 @@ public OAuthTokenGenerateRequest grantType(String grantType) { return this; } - /** + /** * When generating a new token use `authorization_code`. * @return grantType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "When generating a new token use `authorization_code`.") @JsonProperty(JSON_PROPERTY_GRANT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -186,12 +180,11 @@ public OAuthTokenGenerateRequest state(String state) { return this; } - /** + /** * Same as the state you specified earlier. * @return state - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Same as the state you specified earlier.") @JsonProperty(JSON_PROPERTY_STATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java b/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java index d2b351e..28eb1cd 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ OAuthTokenRefreshRequest.JSON_PROPERTY_GRANT_TYPE, OAuthTokenRefreshRequest.JSON_PROPERTY_REFRESH_TOKEN }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenRefreshRequest { public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; private String grantType = "refresh_token"; @@ -70,12 +68,11 @@ public OAuthTokenRefreshRequest grantType(String grantType) { return this; } - /** + /** * When refreshing an existing token use `refresh_token`. * @return grantType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "When refreshing an existing token use `refresh_token`.") @JsonProperty(JSON_PROPERTY_GRANT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public OAuthTokenRefreshRequest refreshToken(String refreshToken) { return this; } - /** + /** * The token provided when you got the expired access token. * @return refreshToken - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The token provided when you got the expired access token.") @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java b/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java index 2fdc60e..94e7073 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ OAuthTokenResponse.JSON_PROPERTY_EXPIRES_IN, OAuthTokenResponse.JSON_PROPERTY_STATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenResponse { public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; private String accessToken; @@ -82,12 +80,11 @@ public OAuthTokenResponse accessToken(String accessToken) { return this; } - /** + /** * Get accessToken * @return accessToken - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public OAuthTokenResponse tokenType(String tokenType) { return this; } - /** + /** * Get tokenType * @return tokenType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public OAuthTokenResponse refreshToken(String refreshToken) { return this; } - /** + /** * Get refreshToken * @return refreshToken - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +155,11 @@ public OAuthTokenResponse expiresIn(Integer expiresIn) { return this; } - /** + /** * Number of seconds until the `access_token` expires. Uses epoch time. * @return expiresIn - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of seconds until the `access_token` expires. Uses epoch time.") @JsonProperty(JSON_PROPERTY_EXPIRES_IN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +180,11 @@ public OAuthTokenResponse state(String state) { return this; } - /** + /** * Get state * @return state - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_STATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java b/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java index 219f6f5..bef5001 100644 --- a/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java @@ -24,12 +24,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ ReportCreateRequest.JSON_PROPERTY_REPORT_TYPE, ReportCreateRequest.JSON_PROPERTY_START_DATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportCreateRequest { public static final String JSON_PROPERTY_END_DATE = "end_date"; private String endDate; @@ -111,12 +109,11 @@ public ReportCreateRequest endDate(String endDate) { return this; } - /** + /** * The (inclusive) end date for the report data in `MM/DD/YYYY` format. * @return endDate - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The (inclusive) end date for the report data in `MM/DD/YYYY` format.") @JsonProperty(JSON_PROPERTY_END_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -145,12 +142,11 @@ public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { return this; } - /** + /** * 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). * @return reportType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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).") @JsonProperty(JSON_PROPERTY_REPORT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,12 +167,11 @@ public ReportCreateRequest startDate(String startDate) { return this; } - /** + /** * The (inclusive) start date for the report data in `MM/DD/YYYY` format. * @return startDate - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The (inclusive) start date for the report data in `MM/DD/YYYY` format.") @JsonProperty(JSON_PROPERTY_START_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java b/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java index 280c7a7..3a042b4 100644 --- a/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ ReportCreateResponse.JSON_PROPERTY_REPORT, ReportCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportCreateResponse { public static final String JSON_PROPERTY_REPORT = "report"; private ReportResponse report; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public ReportCreateResponse() { } @@ -74,14 +72,13 @@ public ReportCreateResponse report(ReportResponse report) { return this; } - /** + /** * Get report * @return report - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ReportResponse getReport() { return report; @@ -89,7 +86,7 @@ public ReportResponse getReport() { @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setReport(ReportResponse report) { this.report = report; } @@ -108,12 +105,11 @@ public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/ReportResponse.java b/src/main/java/com/dropbox/sign/model/ReportResponse.java index 1044758..7491ccb 100644 --- a/src/main/java/com/dropbox/sign/model/ReportResponse.java +++ b/src/main/java/com/dropbox/sign/model/ReportResponse.java @@ -24,27 +24,24 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the report request. */ -@ApiModel(description = "Contains information about the report request.") @JsonPropertyOrder({ ReportResponse.JSON_PROPERTY_SUCCESS, ReportResponse.JSON_PROPERTY_START_DATE, ReportResponse.JSON_PROPERTY_END_DATE, ReportResponse.JSON_PROPERTY_REPORT_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportResponse { public static final String JSON_PROPERTY_SUCCESS = "success"; private String success; @@ -91,7 +88,7 @@ public static ReportTypeEnum fromValue(String value) { } public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; - private List reportType; + private List reportType = null; public ReportResponse() { } @@ -116,12 +113,11 @@ public ReportResponse success(String success) { return this; } - /** + /** * A message indicating the requested operation's success * @return success - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A message indicating the requested operation's success") @JsonProperty(JSON_PROPERTY_SUCCESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +138,11 @@ public ReportResponse startDate(String startDate) { return this; } - /** + /** * The (inclusive) start date for the report data in MM/DD/YYYY format. * @return startDate - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The (inclusive) start date for the report data in MM/DD/YYYY format.") @JsonProperty(JSON_PROPERTY_START_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +163,11 @@ public ReportResponse endDate(String endDate) { return this; } - /** + /** * The (inclusive) end date for the report data in MM/DD/YYYY format. * @return endDate - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The (inclusive) end date for the report data in MM/DD/YYYY format.") @JsonProperty(JSON_PROPERTY_END_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -202,12 +196,11 @@ public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { return this; } - /** + /** * 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). * @return reportType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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).") @JsonProperty(JSON_PROPERTY_REPORT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index 62f470f..0e3b1ce 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -30,12 +30,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -57,8 +55,8 @@ SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -70,22 +68,22 @@ public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { private File signerFile; public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - private List signerList; + private List signerList = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -130,12 +128,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addTemplateIdsItem( return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,12 +153,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId(String cli return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -182,12 +178,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile(File sig return this; } - /** + /** * `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 ``` * @return signerFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`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 ```") @JsonProperty(JSON_PROPERTY_SIGNER_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +211,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem(S return this; } - /** + /** * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. * @return signerList - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") @JsonProperty(JSON_PROPERTY_SIGNER_LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +236,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline(Boolea return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,12 +269,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC cc return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,12 +302,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem return this; } - /** + /** * 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. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +327,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message(String mess return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +360,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem(Str return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -396,12 +385,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl( return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,12 +410,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject(String subj return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -448,12 +435,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode(Boolean te return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -474,12 +460,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title(String title) return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index c4cf32e..f25da05 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -30,12 +30,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -57,8 +55,8 @@ SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestBulkSendWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -67,25 +65,25 @@ public class SignatureRequestBulkSendWithTemplateRequest { private File signerFile; public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - private List signerList; + private List signerList = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -130,12 +128,11 @@ public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String tem return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,12 +153,11 @@ public SignatureRequestBulkSendWithTemplateRequest signerFile(File signerFile) { return this; } - /** + /** * `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 ``` * @return signerFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`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 ```") @JsonProperty(JSON_PROPERTY_SIGNER_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,12 +186,11 @@ public SignatureRequestBulkSendWithTemplateRequest addSignerListItem(SubBulkSign return this; } - /** + /** * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. * @return signerList - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") @JsonProperty(JSON_PROPERTY_SIGNER_LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +211,11 @@ public SignatureRequestBulkSendWithTemplateRequest allowDecline(Boolean allowDec return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,12 +244,11 @@ public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,12 +269,11 @@ public SignatureRequestBulkSendWithTemplateRequest clientId(String clientId) { return this; } - /** + /** * 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. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,12 +302,11 @@ public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem(SubCustom return this; } - /** + /** * 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. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +327,11 @@ public SignatureRequestBulkSendWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +360,11 @@ public SignatureRequestBulkSendWithTemplateRequest putMetadataItem(String key, O return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -396,12 +385,11 @@ public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl(String sig return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,12 +410,11 @@ public SignatureRequestBulkSendWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -448,12 +435,11 @@ public SignatureRequestBulkSendWithTemplateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -474,12 +460,11 @@ public SignatureRequestBulkSendWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java index b3f6680..14fdbca 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java @@ -36,12 +36,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -74,23 +72,23 @@ SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestCreateEmbeddedRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - private List groupedSigners; + private List groupedSigners = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; @@ -99,25 +97,25 @@ public class SignatureRequestCreateEmbeddedRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; @@ -126,7 +124,7 @@ public class SignatureRequestCreateEmbeddedRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -172,12 +170,11 @@ public SignatureRequestCreateEmbeddedRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -206,12 +203,11 @@ public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +236,11 @@ public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +269,11 @@ public SignatureRequestCreateEmbeddedRequest addSignersItem(SubSignatureRequestS return this; } - /** + /** * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -308,12 +302,11 @@ public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem(SubSignatureR return this; } - /** + /** * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return groupedSigners - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -334,12 +327,11 @@ public SignatureRequestCreateEmbeddedRequest allowDecline(Boolean allowDecline) return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -360,12 +352,11 @@ public SignatureRequestCreateEmbeddedRequest allowReassign(Boolean allowReassign return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -394,12 +385,11 @@ public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment at return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +418,11 @@ public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem(String ccEm return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,12 +451,11 @@ public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem(SubCustomField return this; } - /** + /** * 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. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -488,12 +476,11 @@ public SignatureRequestCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldO return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +509,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem(SubFormField return this; } - /** + /** * 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`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,12 +542,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldR return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -590,12 +575,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFor return this; } - /** + /** * 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` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,12 +600,11 @@ public SignatureRequestCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) return this; } - /** + /** * 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. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,12 +625,11 @@ public SignatureRequestCreateEmbeddedRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -676,12 +658,11 @@ public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -702,12 +683,11 @@ public SignatureRequestCreateEmbeddedRequest signingOptions(SubSigningOptions si return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -728,12 +708,11 @@ public SignatureRequestCreateEmbeddedRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -754,12 +733,11 @@ public SignatureRequestCreateEmbeddedRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -780,12 +758,11 @@ public SignatureRequestCreateEmbeddedRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -806,12 +783,11 @@ public SignatureRequestCreateEmbeddedRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * 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`. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -832,12 +808,11 @@ public SignatureRequestCreateEmbeddedRequest populateAutoFillFields(Boolean popu return this; } - /** + /** * 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. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -858,12 +833,11 @@ public SignatureRequestCreateEmbeddedRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index d6eed2a..82e075a 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -31,12 +31,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -60,8 +58,8 @@ SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -76,22 +74,22 @@ public class SignatureRequestCreateEmbeddedWithTemplateRequest { private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -139,12 +137,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addTemplateIdsItem(Stri return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +162,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest clientId(String clientI return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -199,12 +195,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addSignersItem(SubSigna return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,12 +220,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline(Boolean al return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -259,12 +253,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsIte return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,12 +286,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem(Sub return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,12 +319,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File files return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -361,12 +352,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -387,12 +377,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest message(String message) return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -421,12 +410,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem(String return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -447,12 +435,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions(SubSigni return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -473,12 +460,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest subject(String subject) return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -499,12 +485,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest testMode(Boolean testMo return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -525,12 +510,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -551,12 +535,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields( return this; } - /** + /** * 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. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java b/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java index 18be6d5..6f1fe1d 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ SignatureRequestGetResponse.JSON_PROPERTY_SIGNATURE_REQUEST, SignatureRequestGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestGetResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; private SignatureRequestResponse signatureRequest; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public SignatureRequestGetResponse() { } @@ -74,14 +72,13 @@ public SignatureRequestGetResponse signatureRequest(SignatureRequestResponse sig return this; } - /** + /** * Get signatureRequest * @return signatureRequest - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SignatureRequestResponse getSignatureRequest() { return signatureRequest; @@ -89,7 +86,7 @@ public SignatureRequestResponse getSignatureRequest() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequest(SignatureRequestResponse signatureRequest) { this.signatureRequest = signatureRequest; } @@ -108,12 +105,11 @@ public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java b/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java index 4a469da..cbb3d1f 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ SignatureRequestListResponse.JSON_PROPERTY_LIST_INFO, SignatureRequestListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestListResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests; + private List signatureRequests = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public SignatureRequestListResponse() { } @@ -87,14 +85,13 @@ public SignatureRequestListResponse addSignatureRequestsItem(SignatureRequestRes return this; } - /** + /** * Contains information about signature requests. * @return signatureRequests - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains information about signature requests.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSignatureRequests() { return signatureRequests; @@ -102,7 +99,7 @@ public List getSignatureRequests() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequests(List signatureRequests) { this.signatureRequests = signatureRequests; } @@ -113,14 +110,13 @@ public SignatureRequestListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java index ed9ed1a..b736aa7 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SignatureRequestRemindRequest.JSON_PROPERTY_EMAIL_ADDRESS, SignatureRequestRemindRequest.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestRemindRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -70,12 +68,11 @@ public SignatureRequestRemindRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer to send a reminder to. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer to send a reminder to.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SignatureRequestRemindRequest name(String name) { return this; } - /** + /** * The name of the signer to send a reminder to. Include if two or more signers share an email address. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the signer to send a reminder to. Include if two or more signers share an email address.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java index 4576e24..c041d42 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java @@ -28,19 +28,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about a signature request. */ -@ApiModel(description = "Contains information about a signature request.") @JsonPropertyOrder({ SignatureRequestResponse.JSON_PROPERTY_TEST_MODE, SignatureRequestResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, @@ -68,8 +65,8 @@ SignatureRequestResponse.JSON_PROPERTY_SIGNATURES, SignatureRequestResponse.JSON_PROPERTY_BULK_SEND_JOB_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponse { public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; private Boolean testMode = false; @@ -120,7 +117,7 @@ public class SignatureRequestResponse { private String detailsUrl; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -129,19 +126,19 @@ public class SignatureRequestResponse { private String finalCopyUri; public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds; + private List templateIds = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - private List responseData; + private List responseData = null; public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - private List signatures; + private List signatures = null; public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -169,12 +166,11 @@ public SignatureRequestResponse testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +191,11 @@ public SignatureRequestResponse signatureRequestId(String signatureRequestId) { return this; } - /** + /** * The id of the SignatureRequest. * @return signatureRequestId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +216,11 @@ public SignatureRequestResponse requesterEmailAddress(String requesterEmailAddre return this; } - /** + /** * The email address of the initiator of the SignatureRequest. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the initiator of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +241,11 @@ public SignatureRequestResponse title(String title) { return this; } - /** + /** * The title the specified Account uses for the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title the specified Account uses for the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +266,11 @@ public SignatureRequestResponse originalTitle(String originalTitle) { return this; } - /** + /** * Default Label for account. * @return originalTitle - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Default Label for account.") @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +291,11 @@ public SignatureRequestResponse subject(String subject) { return this; } - /** + /** * The subject in the email that was initially sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +316,11 @@ public SignatureRequestResponse message(String message) { return this; } - /** + /** * The custom message in the email that was initially sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +341,11 @@ public SignatureRequestResponse metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the signature request. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the signature request.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -377,12 +366,11 @@ public SignatureRequestResponse createdAt(Integer createdAt) { return this; } - /** + /** * Time the signature request was created. * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time the signature request was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,12 +391,11 @@ public SignatureRequestResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -429,12 +416,11 @@ public SignatureRequestResponse isComplete(Boolean isComplete) { return this; } - /** + /** * Whether or not the SignatureRequest has been fully executed by all signers. * @return isComplete - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been fully executed by all signers.") @JsonProperty(JSON_PROPERTY_IS_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -455,12 +441,11 @@ public SignatureRequestResponse isDeclined(Boolean isDeclined) { return this; } - /** + /** * Whether or not the SignatureRequest has been declined by a signer. * @return isDeclined - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been declined by a signer.") @JsonProperty(JSON_PROPERTY_IS_DECLINED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -481,12 +466,11 @@ public SignatureRequestResponse hasError(Boolean hasError) { return this; } - /** + /** * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * @return hasError - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") @JsonProperty(JSON_PROPERTY_HAS_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -507,12 +491,11 @@ public SignatureRequestResponse filesUrl(String filesUrl) { return this; } - /** + /** * The URL where a copy of the request's documents can be downloaded. * @return filesUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where a copy of the request's documents can be downloaded.") @JsonProperty(JSON_PROPERTY_FILES_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -533,12 +516,11 @@ public SignatureRequestResponse signingUrl(String signingUrl) { return this; } - /** + /** * 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. * @return signingUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SIGNING_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -559,12 +541,11 @@ public SignatureRequestResponse detailsUrl(String detailsUrl) { return this; } - /** + /** * The URL where the requester and the signers can view the current status of the SignatureRequest. * @return detailsUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where the requester and the signers can view the current status of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_DETAILS_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -593,12 +574,11 @@ public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesI return this; } - /** + /** * 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. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -619,12 +599,11 @@ public SignatureRequestResponse signingRedirectUrl(String signingRedirectUrl) { return this; } - /** + /** * The URL you want the signer redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want the signer redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,12 +624,11 @@ public SignatureRequestResponse finalCopyUri(String finalCopyUri) { return this; } - /** + /** * The path where the completed document can be downloaded * @return finalCopyUri - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The path where the completed document can be downloaded") @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -679,12 +657,11 @@ public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { return this; } - /** + /** * Templates IDs used in this SignatureRequest (if any). * @return templateIds - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Templates IDs used in this SignatureRequest (if any).") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -713,12 +690,11 @@ public SignatureRequestResponse addCustomFieldsItem(SignatureRequestResponseCust return this; } - /** + /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -747,12 +723,11 @@ public SignatureRequestResponse addAttachmentsItem(SignatureRequestResponseAttac return this; } - /** + /** * Signer attachments. * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signer attachments.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -781,12 +756,11 @@ public SignatureRequestResponse addResponseDataItem(SignatureRequestResponseData return this; } - /** + /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * @return responseData - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -815,12 +789,11 @@ public SignatureRequestResponse addSignaturesItem(SignatureRequestResponseSignat return this; } - /** + /** * An array of signature objects, 1 for each signer. * @return signatures - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of signature objects, 1 for each signer.") @JsonProperty(JSON_PROPERTY_SIGNATURES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -841,12 +814,11 @@ public SignatureRequestResponse bulkSendJobId(String bulkSendJobId) { return this; } - /** + /** * The ID of the Bulk Send job which sent the signature request, if applicable. * @return bulkSendJobId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the Bulk Send job which sent the signature request, if applicable.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java index 39ce140..125fc66 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Signer attachments. */ -@ApiModel(description = "Signer attachments.") @JsonPropertyOrder({ SignatureRequestResponseAttachment.JSON_PROPERTY_ID, SignatureRequestResponseAttachment.JSON_PROPERTY_SIGNER, @@ -43,8 +40,8 @@ SignatureRequestResponseAttachment.JSON_PROPERTY_INSTRUCTIONS, SignatureRequestResponseAttachment.JSON_PROPERTY_UPLOADED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponseAttachment { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -87,12 +84,11 @@ public SignatureRequestResponseAttachment id(String id) { return this; } - /** + /** * The unique ID for this attachment. * @return id - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique ID for this attachment.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -112,13 +108,16 @@ public SignatureRequestResponseAttachment signer(String signer) { this.signer = signer; return this; } + public SignatureRequestResponseAttachment signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The Signer this attachment is assigned to. * @return signer - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Signer this attachment is assigned to.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,18 +132,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public SignatureRequestResponseAttachment name(String name) { this.name = name; return this; } - /** + /** * The name of this attachment. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this attachment.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +167,11 @@ public SignatureRequestResponseAttachment required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this attachment is required. * @return required - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A boolean value denoting if this attachment is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,12 +192,11 @@ public SignatureRequestResponseAttachment instructions(String instructions) { return this; } - /** + /** * Instructions for Signer. * @return instructions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Instructions for Signer.") @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +217,11 @@ public SignatureRequestResponseAttachment uploadedAt(Integer uploadedAt) { return this; } - /** + /** * Timestamp when attachment was uploaded by Signer. * @return uploadedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when attachment was uploaded by Signer.") @JsonProperty(JSON_PROPERTY_UPLOADED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java index 4117ca6..fca2222 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` */ -@ApiModel(description = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonPropertyOrder({ SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_TYPE, SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_NAME, @@ -45,8 +42,11 @@ SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_API_ID, SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_EDITOR }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "checkbox"), @@ -92,12 +92,11 @@ public SignatureRequestResponseCustomFieldBase type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -118,12 +117,11 @@ public SignatureRequestResponseCustomFieldBase name(String name) { return this; } - /** + /** * The name of the Custom Field. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Custom Field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -144,12 +142,11 @@ public SignatureRequestResponseCustomFieldBase required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A boolean value denoting if this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,12 +167,11 @@ public SignatureRequestResponseCustomFieldBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +192,11 @@ public SignatureRequestResponseCustomFieldBase editor(String editor) { return this; } - /** + /** * The name of the Role that is able to edit this field. * @return editor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Role that is able to edit this field.") @JsonProperty(JSON_PROPERTY_EDITOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java index e40cd61..9943467 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java @@ -26,25 +26,25 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SignatureRequestResponseCustomFieldBase`. */ -@ApiModel(description = "This class extends `SignatureRequestResponseCustomFieldBase`.") @JsonPropertyOrder({ SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { @@ -77,12 +77,11 @@ public SignatureRequestResponseCustomFieldCheckbox type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -103,12 +102,11 @@ public SignatureRequestResponseCustomFieldCheckbox value(Boolean value) { return this; } - /** + /** * A true/false for checkbox fields * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A true/false for checkbox fields") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java index 5a1af3d..9c7e628 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java @@ -26,25 +26,25 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SignatureRequestResponseCustomFieldBase`. */ -@ApiModel(description = "This class extends `SignatureRequestResponseCustomFieldBase`.") @JsonPropertyOrder({ SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { @@ -77,12 +77,11 @@ public SignatureRequestResponseCustomFieldText type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -103,12 +102,11 @@ public SignatureRequestResponseCustomFieldText value(String value) { return this; } - /** + /** * A text string for text fields * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A text string for text fields") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java index 9dc1e0c..c4ae5b3 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java index b2c03dd..5478862 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. */ -@ApiModel(description = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonPropertyOrder({ SignatureRequestResponseDataBase.JSON_PROPERTY_API_ID, SignatureRequestResponseDataBase.JSON_PROPERTY_SIGNATURE_ID, @@ -45,8 +42,11 @@ SignatureRequestResponseDataBase.JSON_PROPERTY_REQUIRED, SignatureRequestResponseDataBase.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), @@ -99,12 +99,11 @@ public SignatureRequestResponseDataBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,12 +124,11 @@ public SignatureRequestResponseDataBase signatureId(String signatureId) { return this; } - /** + /** * The ID of the signature to which this response is linked. * @return signatureId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the signature to which this response is linked.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,12 +149,11 @@ public SignatureRequestResponseDataBase name(String name) { return this; } - /** + /** * The name of the form field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the form field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -177,12 +174,11 @@ public SignatureRequestResponseDataBase required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A boolean value denoting if this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,12 +199,11 @@ public SignatureRequestResponseDataBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java index 388b25d..b2e6295 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java index 882ddc5..ed72505 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueCheckbox type(String type) { return this; } - /** + /** * A yes/no checkbox * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A yes/no checkbox") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueCheckbox value(Boolean value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java index f1cdac6..386212b 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueCheckboxMerge type(String type) { return this; } - /** + /** * A checkbox field that has default value set by the api * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A checkbox field that has default value set by the api") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueCheckboxMerge value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java index 6090fb7..c793034 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueDateSigned type(String type) { return this; } - /** + /** * A date * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A date") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueDateSigned value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java index 02ef72b..9f72ae3 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueDropdown type(String type) { return this; } - /** + /** * An input field for dropdowns * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An input field for dropdowns") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueDropdown value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java index f4ac266..cab08d9 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueInitials type(String type) { return this; } - /** + /** * An input field for initials * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An input field for initials") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueInitials value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java index 8337d4b..a317694 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueRadio type(String type) { return this; } - /** + /** * An input field for radios * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An input field for radios") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueRadio value(Boolean value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java index b8e57ae..79eb3b4 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueSignature type(String type) { return this; } - /** + /** * A signature input field * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A signature input field") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueSignature value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java index ba47f5d..47f82d4 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueText type(String type) { return this; } - /** + /** * A text input field * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A text input field") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueText value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java index 2b53fce..c25f4b1 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueTextMerge type(String type) { return this; } - /** + /** * A text field that has default text set by the api * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A text field that has default text set by the api") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueTextMerge value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java index b9b25cc..16e2020 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of signature objects, 1 for each signer. */ -@ApiModel(description = "An array of signature objects, 1 for each signer.") @JsonPropertyOrder({ SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNATURE_ID, SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_GROUP_GUID, @@ -56,8 +53,8 @@ SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_FROM, SignatureRequestResponseSignatures.JSON_PROPERTY_ERROR }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponseSignatures { public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; private String signatureId; @@ -139,12 +136,11 @@ public SignatureRequestResponseSignatures signatureId(String signatureId) { return this; } - /** + /** * Signature identifier. * @return signatureId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature identifier.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +161,11 @@ public SignatureRequestResponseSignatures signerGroupGuid(String signerGroupGuid return this; } - /** + /** * Signer Group GUID * @return signerGroupGuid - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signer Group GUID") @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +186,11 @@ public SignatureRequestResponseSignatures signerEmailAddress(String signerEmailA return this; } - /** + /** * The email address of the signer. * @return signerEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +211,11 @@ public SignatureRequestResponseSignatures signerName(String signerName) { return this; } - /** + /** * The name of the signer. * @return signerName - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,12 +236,11 @@ public SignatureRequestResponseSignatures signerRole(String signerRole) { return this; } - /** + /** * The role of the signer. * @return signerRole - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The role of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,12 +261,11 @@ public SignatureRequestResponseSignatures order(Integer order) { return this; } - /** + /** * If signer order is assigned this is the 0-based index for this signer. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "If signer order is assigned this is the 0-based index for this signer.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +286,11 @@ public SignatureRequestResponseSignatures statusCode(String statusCode) { return this; } - /** + /** * The current status of the signature. eg: awaiting_signature, signed, declined. * @return statusCode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The current status of the signature. eg: awaiting_signature, signed, declined.") @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -321,12 +311,11 @@ public SignatureRequestResponseSignatures declineReason(String declineReason) { return this; } - /** + /** * The reason provided by the signer for declining the request. * @return declineReason - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The reason provided by the signer for declining the request.") @JsonProperty(JSON_PROPERTY_DECLINE_REASON) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -347,12 +336,11 @@ public SignatureRequestResponseSignatures signedAt(Integer signedAt) { return this; } - /** + /** * Time that the document was signed or null. * @return signedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time that the document was signed or null.") @JsonProperty(JSON_PROPERTY_SIGNED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +361,11 @@ public SignatureRequestResponseSignatures lastViewedAt(Integer lastViewedAt) { return this; } - /** + /** * The time that the document was last viewed by this signer or null. * @return lastViewedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time that the document was last viewed by this signer or null.") @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -399,12 +386,11 @@ public SignatureRequestResponseSignatures lastRemindedAt(Integer lastRemindedAt) return this; } - /** + /** * The time the last reminder email was sent to the signer or null. * @return lastRemindedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time the last reminder email was sent to the signer or null.") @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -425,12 +411,11 @@ public SignatureRequestResponseSignatures hasPin(Boolean hasPin) { return this; } - /** + /** * Boolean to indicate whether this signature requires a PIN to access. * @return hasPin - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature requires a PIN to access.") @JsonProperty(JSON_PROPERTY_HAS_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -451,12 +436,11 @@ public SignatureRequestResponseSignatures hasSmsAuth(Boolean hasSmsAuth) { return this; } - /** + /** * Boolean to indicate whether this signature has SMS authentication enabled. * @return hasSmsAuth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature has SMS authentication enabled.") @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -477,12 +461,11 @@ public SignatureRequestResponseSignatures hasSmsDelivery(Boolean hasSmsDelivery) return this; } - /** + /** * Boolean to indicate whether this signature has SMS delivery enabled. * @return hasSmsDelivery - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature has SMS delivery enabled.") @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -503,12 +486,11 @@ public SignatureRequestResponseSignatures smsPhoneNumber(String smsPhoneNumber) return this; } - /** + /** * The SMS phone number used for authentication or signature request delivery. * @return smsPhoneNumber - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The SMS phone number used for authentication or signature request delivery.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -529,12 +511,11 @@ public SignatureRequestResponseSignatures reassignedBy(String reassignedBy) { return this; } - /** + /** * Email address of original signer who reassigned to this signer. * @return reassignedBy - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Email address of original signer who reassigned to this signer.") @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -555,12 +536,11 @@ public SignatureRequestResponseSignatures reassignmentReason(String reassignment return this; } - /** + /** * Reason provided by original signer who reassigned to this signer. * @return reassignmentReason - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Reason provided by original signer who reassigned to this signer.") @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -581,12 +561,11 @@ public SignatureRequestResponseSignatures reassignedFrom(String reassignedFrom) return this; } - /** + /** * Previous signature identifier. * @return reassignedFrom - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Previous signature identifier.") @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -607,12 +586,11 @@ public SignatureRequestResponseSignatures error(String error) { return this; } - /** + /** * Error message pertaining to this signer, or null. * @return error - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Error message pertaining to this signer, or null.") @JsonProperty(JSON_PROPERTY_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java index 47d5057..160f345 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java @@ -36,12 +36,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -76,20 +74,20 @@ SignatureRequestSendRequest.JSON_PROPERTY_USE_TEXT_TAGS, SignatureRequestSendRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestSendRequest { public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - private List groupedSigners; + private List groupedSigners = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; @@ -98,33 +96,34 @@ public class SignatureRequestSendRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; public static final String JSON_PROPERTY_IS_EID = "is_eid"; @@ -134,7 +133,7 @@ public class SignatureRequestSendRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -188,12 +187,11 @@ public SignatureRequestSendRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -222,12 +220,11 @@ public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +253,11 @@ public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner sign return this; } - /** + /** * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,12 +286,11 @@ public SignatureRequestSendRequest addGroupedSignersItem(SubSignatureRequestGrou return this; } - /** + /** * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return groupedSigners - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +311,11 @@ public SignatureRequestSendRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,12 +336,11 @@ public SignatureRequestSendRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * 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. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +369,11 @@ public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsI return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,12 +402,11 @@ public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddress return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -436,12 +427,11 @@ public SignatureRequestSendRequest clientId(String clientId) { return this; } - /** + /** * 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. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +460,11 @@ public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFiel return this; } - /** + /** * 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. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +485,11 @@ public SignatureRequestSendRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +518,11 @@ public SignatureRequestSendRequest addFormFieldGroupsItem(SubFormFieldGroup form return this; } - /** + /** * 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`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -564,12 +551,11 @@ public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFi return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -598,12 +584,11 @@ public SignatureRequestSendRequest addFormFieldsPerDocumentItem(SubFormFieldsPer return this; } - /** + /** * 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` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -624,12 +609,11 @@ public SignatureRequestSendRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * 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. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,19 +629,19 @@ public void setHideTextTags(Boolean hideTextTags) { } + @Deprecated public SignatureRequestSendRequest isQualifiedSignature(Boolean isQualifiedSignature) { this.isQualifiedSignature = isQualifiedSignature; return this; } - /** + /** * 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. * @return isQualifiedSignature * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -666,6 +650,7 @@ public Boolean getIsQualifiedSignature() { } + @Deprecated @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsQualifiedSignature(Boolean isQualifiedSignature) { @@ -678,12 +663,11 @@ public SignatureRequestSendRequest isEid(Boolean isEid) { return this; } - /** + /** * 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. * @return isEid - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_EID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -704,12 +688,11 @@ public SignatureRequestSendRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -738,12 +721,11 @@ public SignatureRequestSendRequest putMetadataItem(String key, Object metadataIt return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -764,12 +746,11 @@ public SignatureRequestSendRequest signingOptions(SubSigningOptions signingOptio return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -790,12 +771,11 @@ public SignatureRequestSendRequest signingRedirectUrl(String signingRedirectUrl) return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -816,12 +796,11 @@ public SignatureRequestSendRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -842,12 +821,11 @@ public SignatureRequestSendRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -868,12 +846,11 @@ public SignatureRequestSendRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -894,12 +871,11 @@ public SignatureRequestSendRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * 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`. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -920,12 +896,11 @@ public SignatureRequestSendRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index ea993eb..c498d87 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -31,19 +31,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * */ -@ApiModel(description = "") @JsonPropertyOrder({ SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNERS, @@ -63,8 +60,8 @@ SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestSendWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -76,21 +73,22 @@ public class SignatureRequestSendWithTemplateRequest { private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; public static final String JSON_PROPERTY_IS_EID = "is_eid"; @@ -100,7 +98,7 @@ public class SignatureRequestSendWithTemplateRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -148,12 +146,11 @@ public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templat return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -182,12 +179,11 @@ public SignatureRequestSendWithTemplateRequest addSignersItem(SubSignatureReques return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -208,12 +204,11 @@ public SignatureRequestSendWithTemplateRequest allowDecline(Boolean allowDecline return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +237,11 @@ public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,12 +262,11 @@ public SignatureRequestSendWithTemplateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -302,12 +295,11 @@ public SignatureRequestSendWithTemplateRequest addCustomFieldsItem(SubCustomFiel return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +328,11 @@ public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +361,11 @@ public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsIt return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -391,19 +381,19 @@ public void setFileUrls(List fileUrls) { } + @Deprecated public SignatureRequestSendWithTemplateRequest isQualifiedSignature(Boolean isQualifiedSignature) { this.isQualifiedSignature = isQualifiedSignature; return this; } - /** + /** * 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. * @return isQualifiedSignature * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -412,6 +402,7 @@ public Boolean getIsQualifiedSignature() { } + @Deprecated @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsQualifiedSignature(Boolean isQualifiedSignature) { @@ -424,12 +415,11 @@ public SignatureRequestSendWithTemplateRequest isEid(Boolean isEid) { return this; } - /** + /** * 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. * @return isEid - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_EID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -450,12 +440,11 @@ public SignatureRequestSendWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -484,12 +473,11 @@ public SignatureRequestSendWithTemplateRequest putMetadataItem(String key, Objec return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -510,12 +498,11 @@ public SignatureRequestSendWithTemplateRequest signingOptions(SubSigningOptions return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -536,12 +523,11 @@ public SignatureRequestSendWithTemplateRequest signingRedirectUrl(String signing return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -562,12 +548,11 @@ public SignatureRequestSendWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -588,12 +573,11 @@ public SignatureRequestSendWithTemplateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -614,12 +598,11 @@ public SignatureRequestSendWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java index df0f1ac..e5b31ad 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ SignatureRequestUpdateRequest.JSON_PROPERTY_NAME, SignatureRequestUpdateRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestUpdateRequest { public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; private String signatureId; @@ -78,12 +76,11 @@ public SignatureRequestUpdateRequest signatureId(String signatureId) { return this; } - /** + /** * The signature ID for the recipient. * @return signatureId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The signature ID for the recipient.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public SignatureRequestUpdateRequest emailAddress(String emailAddress) { return this; } - /** + /** * The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +126,11 @@ public SignatureRequestUpdateRequest name(String name) { return this; } - /** + /** * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new name for the recipient. **NOTE:** Optional if `email_address` is provided.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public SignatureRequestUpdateRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubAttachment.java b/src/main/java/com/dropbox/sign/model/SubAttachment.java index a95c905..47c26c1 100644 --- a/src/main/java/com/dropbox/sign/model/SubAttachment.java +++ b/src/main/java/com/dropbox/sign/model/SubAttachment.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ SubAttachment.JSON_PROPERTY_INSTRUCTIONS, SubAttachment.JSON_PROPERTY_REQUIRED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubAttachment { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -78,12 +76,11 @@ public SubAttachment name(String name) { return this; } - /** + /** * The name of attachment. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of attachment.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public SubAttachment signerIndex(Integer signerIndex) { return this; } - /** + /** * The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. * @return signerIndex - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment.") @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -130,12 +126,11 @@ public SubAttachment instructions(String instructions) { return this; } - /** + /** * The instructions for uploading the attachment. * @return instructions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The instructions for uploading the attachment.") @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public SubAttachment required(Boolean required) { return this; } - /** + /** * Determines if the attachment must be uploaded. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Determines if the attachment must be uploaded.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java b/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java index a708a1d..670dd4b 100644 --- a/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java +++ b/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ SubBulkSignerList.JSON_PROPERTY_CUSTOM_FIELDS, SubBulkSignerList.JSON_PROPERTY_SIGNERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubBulkSignerList { public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public SubBulkSignerList() { } @@ -82,12 +80,11 @@ public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField custom return this; } - /** + /** * An array of custom field values. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of custom field values.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,12 +113,11 @@ public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signer return this; } - /** + /** * 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. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(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.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java b/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java index 1c00daf..f2b250c 100644 --- a/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java +++ b/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubBulkSignerListCustomField.JSON_PROPERTY_NAME, SubBulkSignerListCustomField.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubBulkSignerListCustomField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public SubBulkSignerListCustomField name(String name) { return this; } - /** + /** * The name of the custom field. Must be the field's `name` or `api_id`. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the custom field. Must be the field's `name` or `api_id`.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SubBulkSignerListCustomField value(String value) { return this; } - /** + /** * The value of the custom field. * @return value - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value of the custom field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubCC.java b/src/main/java/com/dropbox/sign/model/SubCC.java index e70c752..1edd1df 100644 --- a/src/main/java/com/dropbox/sign/model/SubCC.java +++ b/src/main/java/com/dropbox/sign/model/SubCC.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubCC.JSON_PROPERTY_ROLE, SubCC.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubCC { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -70,12 +68,11 @@ public SubCC role(String role) { return this; } - /** + /** * Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. * @return role - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SubCC emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the CC recipient. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the CC recipient.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubCustomField.java b/src/main/java/com/dropbox/sign/model/SubCustomField.java index 036e1ed..027d857 100644 --- a/src/main/java/com/dropbox/sign/model/SubCustomField.java +++ b/src/main/java/com/dropbox/sign/model/SubCustomField.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * 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. */ -@ApiModel(description = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonPropertyOrder({ SubCustomField.JSON_PROPERTY_NAME, SubCustomField.JSON_PROPERTY_EDITOR, SubCustomField.JSON_PROPERTY_REQUIRED, SubCustomField.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubCustomField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -79,12 +76,11 @@ public SubCustomField name(String name) { return this; } - /** + /** * 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. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -105,12 +101,11 @@ public SubCustomField editor(String editor) { return this; } - /** + /** * 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. * @return editor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EDITOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public SubCustomField required(Boolean required) { return this; } - /** + /** * 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`. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public SubCustomField value(String value) { return this; } - /** + /** * The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubEditorOptions.java b/src/main/java/com/dropbox/sign/model/SubEditorOptions.java index 16d7823..0d2542d 100644 --- a/src/main/java/com/dropbox/sign/model/SubEditorOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubEditorOptions.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify editor options when a preparing a document */ -@ApiModel(description = "This allows the requester to specify editor options when a preparing a document") @JsonPropertyOrder({ SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_SIGNERS, SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubEditorOptions { public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; private Boolean allowEditSigners = false; @@ -71,12 +68,11 @@ public SubEditorOptions allowEditSigners(Boolean allowEditSigners) { return this; } - /** + /** * Allows requesters to edit the list of signers * @return allowEditSigners - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows requesters to edit the list of signers") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public SubEditorOptions allowEditDocuments(Boolean allowEditDocuments) { return this; } - /** + /** * Allows requesters to edit documents, including delete and add * @return allowEditDocuments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows requesters to edit documents, including delete and add") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFieldOptions.java b/src/main/java/com/dropbox/sign/model/SubFieldOptions.java index 20006cc..186faba 100644 --- a/src/main/java/com/dropbox/sign/model/SubFieldOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubFieldOptions.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify field options for a signature request. */ -@ApiModel(description = "This allows the requester to specify field options for a signature request.") @JsonPropertyOrder({ SubFieldOptions.JSON_PROPERTY_DATE_FORMAT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFieldOptions { /** * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. @@ -110,12 +107,11 @@ public SubFieldOptions dateFormat(DateFormatEnum dateFormat) { return this; } - /** + /** * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. * @return dateFormat - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher.") @JsonProperty(JSON_PROPERTY_DATE_FORMAT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java b/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java index a671ea3..80dd46e 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ SubFormFieldGroup.JSON_PROPERTY_GROUP_LABEL, SubFormFieldGroup.JSON_PROPERTY_REQUIREMENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldGroup { public static final String JSON_PROPERTY_GROUP_ID = "group_id"; private String groupId; @@ -74,12 +72,11 @@ public SubFormFieldGroup groupId(String groupId) { return this; } - /** + /** * ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. * @return groupId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_GROUP_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubFormFieldGroup groupLabel(String groupLabel) { return this; } - /** + /** * Name of the group * @return groupLabel - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the group") @JsonProperty(JSON_PROPERTY_GROUP_LABEL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubFormFieldGroup requirement(String requirement) { return this; } - /** + /** * 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. * @return requirement - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_REQUIREMENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java b/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java index 72651a9..629d8f4 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,8 +42,8 @@ SubFormFieldRule.JSON_PROPERTY_TRIGGERS, SubFormFieldRule.JSON_PROPERTY_ACTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRule { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -82,12 +80,11 @@ public SubFormFieldRule id(String id) { return this; } - /** + /** * Must be unique across all defined rules. * @return id - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must be unique across all defined rules.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public SubFormFieldRule triggerOperator(String triggerOperator) { return this; } - /** + /** * Currently only `AND` is supported. Support for `OR` is being worked on. * @return triggerOperator - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Currently only `AND` is supported. Support for `OR` is being worked on.") @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -142,12 +138,11 @@ public SubFormFieldRule addTriggersItem(SubFormFieldRuleTrigger triggersItem) { return this; } - /** + /** * An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. * @return triggers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed.") @JsonProperty(JSON_PROPERTY_TRIGGERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -176,12 +171,11 @@ public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { return this; } - /** + /** * 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. * @return actions - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_ACTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java index 564baaa..7aebfc1 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ SubFormFieldRuleAction.JSON_PROPERTY_FIELD_ID, SubFormFieldRuleAction.JSON_PROPERTY_GROUP_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRuleAction { public static final String JSON_PROPERTY_HIDDEN = "hidden"; private Boolean hidden; @@ -113,12 +111,11 @@ public SubFormFieldRuleAction hidden(Boolean hidden) { return this; } - /** + /** * `true` to hide the target field when rule is satisfied, otherwise `false`. * @return hidden - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` to hide the target field when rule is satisfied, otherwise `false`.") @JsonProperty(JSON_PROPERTY_HIDDEN) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -139,12 +136,11 @@ public SubFormFieldRuleAction type(TypeEnum type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +161,11 @@ public SubFormFieldRuleAction fieldId(String fieldId) { return this; } - /** + /** * **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. * @return fieldId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**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.") @JsonProperty(JSON_PROPERTY_FIELD_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +186,11 @@ public SubFormFieldRuleAction groupId(String groupId) { return this; } - /** + /** * **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. * @return groupId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**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.") @JsonProperty(JSON_PROPERTY_GROUP_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java index e3c7bf2..466d619 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java @@ -24,12 +24,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubFormFieldRuleTrigger.JSON_PROPERTY_VALUE, SubFormFieldRuleTrigger.JSON_PROPERTY_VALUES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRuleTrigger { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -96,7 +94,7 @@ public static OperatorEnum fromValue(String value) { private String value; public static final String JSON_PROPERTY_VALUES = "values"; - private List values; + private List values = null; public SubFormFieldRuleTrigger() { } @@ -121,12 +119,11 @@ public SubFormFieldRuleTrigger id(String id) { return this; } - /** + /** * 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. * @return id - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubFormFieldRuleTrigger operator(OperatorEnum operator) { return this; } - /** + /** * 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 * @return operator - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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") @JsonProperty(JSON_PROPERTY_OPERATOR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubFormFieldRuleTrigger value(String value) { return this; } - /** + /** * **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` * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**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`") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -207,12 +202,11 @@ public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { return this; } - /** + /** * **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` * @return values - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`") @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java index 519b3a2..a0a5217 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * 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` */ -@ApiModel(description = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonPropertyOrder({ SubFormFieldsPerDocumentBase.JSON_PROPERTY_DOCUMENT_INDEX, SubFormFieldsPerDocumentBase.JSON_PROPERTY_API_ID, @@ -51,8 +48,11 @@ SubFormFieldsPerDocumentBase.JSON_PROPERTY_NAME, SubFormFieldsPerDocumentBase.JSON_PROPERTY_PAGE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), @@ -124,12 +124,11 @@ public SubFormFieldsPerDocumentBase documentIndex(Integer documentIndex) { return this; } - /** + /** * Represents the integer index of the `file` or `file_url` document the field should be attached to. * @return documentIndex - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Represents the integer index of the `file` or `file_url` document the field should be attached to.") @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -150,12 +149,11 @@ public SubFormFieldsPerDocumentBase apiId(String apiId) { return this; } - /** + /** * An identifier for the field that is unique across all documents in the request. * @return apiId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An identifier for the field that is unique across all documents in the request.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -176,12 +174,11 @@ public SubFormFieldsPerDocumentBase height(Integer height) { return this; } - /** + /** * Size of the field in pixels. * @return height - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Size of the field in pixels.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -202,12 +199,11 @@ public SubFormFieldsPerDocumentBase required(Boolean required) { return this; } - /** + /** * Whether this field is required. * @return required - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -232,12 +228,11 @@ public SubFormFieldsPerDocumentBase signer(Integer signer) { return this; } - /** + /** * 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. * @return signer - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -262,12 +257,11 @@ public SubFormFieldsPerDocumentBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -288,12 +282,11 @@ public SubFormFieldsPerDocumentBase width(Integer width) { return this; } - /** + /** * Size of the field in pixels. * @return width - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Size of the field in pixels.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -314,12 +307,11 @@ public SubFormFieldsPerDocumentBase x(Integer x) { return this; } - /** + /** * Location coordinates of the field in pixels. * @return x - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Location coordinates of the field in pixels.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -340,12 +332,11 @@ public SubFormFieldsPerDocumentBase y(Integer y) { return this; } - /** + /** * Location coordinates of the field in pixels. * @return y - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Location coordinates of the field in pixels.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -366,12 +357,11 @@ public SubFormFieldsPerDocumentBase name(String name) { return this; } - /** + /** * Display name for the field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Display name for the field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -392,12 +382,11 @@ public SubFormFieldsPerDocumentBase page(Integer page) { return this; } - /** + /** * 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. * @return page - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java index 87b00d2..25cc889 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_IS_CHECKED, SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { @@ -81,12 +81,11 @@ public SubFormFieldsPerDocumentCheckbox type(String type) { return this; } - /** + /** * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,12 +106,11 @@ public SubFormFieldsPerDocumentCheckbox isChecked(Boolean isChecked) { return this; } - /** + /** * `true` for checking the checkbox field by default, otherwise `false`. * @return isChecked - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` for checking the checkbox field by default, otherwise `false`.") @JsonProperty(JSON_PROPERTY_IS_CHECKED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,12 +131,11 @@ public SubFormFieldsPerDocumentCheckbox group(String group) { return this; } - /** + /** * String referencing group defined in `form_field_groups` parameter. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "String referencing group defined in `form_field_groups` parameter.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java index 09f6472..ea0b0df 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { @@ -73,12 +73,11 @@ public SubFormFieldsPerDocumentCheckboxMerge type(String type) { return this; } - /** + /** * A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java index 4f5a7bf..ff67323 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { @@ -76,17 +76,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -144,12 +144,11 @@ public SubFormFieldsPerDocumentDateSigned type(String type) { return this; } - /** + /** * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A date. Use the `SubFormFieldsPerDocumentDateSigned` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -170,12 +169,11 @@ public SubFormFieldsPerDocumentDateSigned fontFamily(FontFamilyEnum fontFamily) return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +194,11 @@ public SubFormFieldsPerDocumentDateSigned fontSize(Integer fontSize) { return this; } - /** + /** * 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. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java index 40281f6..ce35e13 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java @@ -28,19 +28,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_OPTIONS, @@ -48,8 +45,11 @@ SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { @@ -86,17 +86,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -154,12 +154,11 @@ public SubFormFieldsPerDocumentDropdown type(String type) { return this; } - /** + /** * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -188,12 +187,11 @@ public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { return this; } - /** + /** * Array of string values representing dropdown values. * @return options - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array of string values representing dropdown values.") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -214,12 +212,11 @@ public SubFormFieldsPerDocumentDropdown content(String content) { return this; } - /** + /** * Selected value in `options` array. Value must exist in array. * @return content - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Selected value in `options` array. Value must exist in array.") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +237,11 @@ public SubFormFieldsPerDocumentDropdown fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -266,12 +262,11 @@ public SubFormFieldsPerDocumentDropdown fontSize(Integer fontSize) { return this; } - /** + /** * 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. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java index 3b3eb68..f557d5a 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonCreator; @@ -52,17 +50,17 @@ public enum SubFormFieldsPerDocumentFontEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java index 761acfc..44cb483 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java @@ -26,19 +26,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT, @@ -46,8 +43,11 @@ SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { @@ -84,17 +84,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -152,12 +152,11 @@ public SubFormFieldsPerDocumentHyperlink type(String type) { return this; } - /** + /** * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -178,12 +177,11 @@ public SubFormFieldsPerDocumentHyperlink content(String content) { return this; } - /** + /** * Link Text. * @return content - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link Text.") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,12 +202,11 @@ public SubFormFieldsPerDocumentHyperlink contentUrl(String contentUrl) { return this; } - /** + /** * Link URL. * @return contentUrl - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link URL.") @JsonProperty(JSON_PROPERTY_CONTENT_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -230,12 +227,11 @@ public SubFormFieldsPerDocumentHyperlink fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +252,11 @@ public SubFormFieldsPerDocumentHyperlink fontSize(Integer fontSize) { return this; } - /** + /** * 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. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java index 14732cf..886c59f 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { @@ -73,12 +73,11 @@ public SubFormFieldsPerDocumentInitials type(String type) { return this; } - /** + /** * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java index 3fb7c50..b21b9da 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentRadio.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentRadio.JSON_PROPERTY_GROUP, SubFormFieldsPerDocumentRadio.JSON_PROPERTY_IS_CHECKED }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { @@ -81,12 +81,11 @@ public SubFormFieldsPerDocumentRadio type(String type) { return this; } - /** + /** * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,12 +106,11 @@ public SubFormFieldsPerDocumentRadio group(String group) { return this; } - /** + /** * String referencing group defined in `form_field_groups` parameter. * @return group - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "String referencing group defined in `form_field_groups` parameter.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,12 +131,11 @@ public SubFormFieldsPerDocumentRadio isChecked(Boolean isChecked) { return this; } - /** + /** * `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. * @return isChecked - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`.") @JsonProperty(JSON_PROPERTY_IS_CHECKED) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java index f58d017..fb56d68 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { @@ -73,12 +73,11 @@ public SubFormFieldsPerDocumentSignature type(String type) { return this; } - /** + /** * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java index 983a100..385ec28 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java @@ -26,19 +26,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentText.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentText.JSON_PROPERTY_PLACEHOLDER, @@ -52,8 +49,11 @@ SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { @@ -159,17 +159,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -227,12 +227,11 @@ public SubFormFieldsPerDocumentText type(String type) { return this; } - /** + /** * A text input field. Use the `SubFormFieldsPerDocumentText` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A text input field. Use the `SubFormFieldsPerDocumentText` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -253,12 +252,11 @@ public SubFormFieldsPerDocumentText placeholder(String placeholder) { return this; } - /** + /** * Placeholder value for text field. * @return placeholder - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Placeholder value for text field.") @JsonProperty(JSON_PROPERTY_PLACEHOLDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -279,12 +277,11 @@ public SubFormFieldsPerDocumentText autoFillType(String autoFillType) { return this; } - /** + /** * 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. * @return autoFillType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,12 +302,11 @@ public SubFormFieldsPerDocumentText linkId(String linkId) { return this; } - /** + /** * Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. * @return linkId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.") @JsonProperty(JSON_PROPERTY_LINK_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -331,12 +327,11 @@ public SubFormFieldsPerDocumentText masked(Boolean masked) { return this; } - /** + /** * 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`. * @return masked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_MASKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -357,12 +352,11 @@ public SubFormFieldsPerDocumentText validationType(ValidationTypeEnum validation return this; } - /** + /** * 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. * @return validationType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -383,12 +377,11 @@ public SubFormFieldsPerDocumentText validationCustomRegex(String validationCusto return this; } - /** + /** * Get validationCustomRegex * @return validationCustomRegex - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -409,12 +402,11 @@ public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel(String vali return this; } - /** + /** * Get validationCustomRegexFormatLabel * @return validationCustomRegexFormatLabel - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -435,12 +427,11 @@ public SubFormFieldsPerDocumentText content(String content) { return this; } - /** + /** * Content of a `me_now` text field * @return content - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Content of a `me_now` text field") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -461,12 +452,11 @@ public SubFormFieldsPerDocumentText fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -487,12 +477,11 @@ public SubFormFieldsPerDocumentText fontSize(Integer fontSize) { return this; } - /** + /** * 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. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java index 3c65570..799a0ef 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { @@ -76,17 +76,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -144,12 +144,11 @@ public SubFormFieldsPerDocumentTextMerge type(String type) { return this; } - /** + /** * A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -170,12 +169,11 @@ public SubFormFieldsPerDocumentTextMerge fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +194,11 @@ public SubFormFieldsPerDocumentTextMerge fontSize(Integer fontSize) { return this; } - /** + /** * 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. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java index 8670fca..2b9d9c0 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/src/main/java/com/dropbox/sign/model/SubMergeField.java b/src/main/java/com/dropbox/sign/model/SubMergeField.java index f4ffce0..cc61287 100644 --- a/src/main/java/com/dropbox/sign/model/SubMergeField.java +++ b/src/main/java/com/dropbox/sign/model/SubMergeField.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubMergeField.JSON_PROPERTY_NAME, SubMergeField.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubMergeField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -105,12 +103,11 @@ public SubMergeField name(String name) { return this; } - /** + /** * The name of the merge field. Must be unique. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the merge field. Must be unique.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -131,12 +128,11 @@ public SubMergeField type(TypeEnum type) { return this; } - /** + /** * The type of merge field. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of merge field.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubOAuth.java b/src/main/java/com/dropbox/sign/model/SubOAuth.java index 113f43e..c997626 100644 --- a/src/main/java/com/dropbox/sign/model/SubOAuth.java +++ b/src/main/java/com/dropbox/sign/model/SubOAuth.java @@ -24,25 +24,22 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * OAuth related parameters. */ -@ApiModel(description = "OAuth related parameters.") @JsonPropertyOrder({ SubOAuth.JSON_PROPERTY_CALLBACK_URL, SubOAuth.JSON_PROPERTY_SCOPES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubOAuth { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -95,7 +92,7 @@ public static ScopesEnum fromValue(String value) { } public static final String JSON_PROPERTY_SCOPES = "scopes"; - private List scopes; + private List scopes = null; public SubOAuth() { } @@ -120,12 +117,11 @@ public SubOAuth callbackUrl(String callbackUrl) { return this; } - /** + /** * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided)") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,12 +150,11 @@ public SubOAuth addScopesItem(ScopesEnum scopesItem) { return this; } - /** + /** * A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). * @return scopes - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).") @JsonProperty(JSON_PROPERTY_SCOPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubOptions.java b/src/main/java/com/dropbox/sign/model/SubOptions.java index dd1ad7a..73d5df6 100644 --- a/src/main/java/com/dropbox/sign/model/SubOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubOptions.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Additional options supported by API App. */ -@ApiModel(description = "Additional options supported by API App.") @JsonPropertyOrder({ SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubOptions { public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; private Boolean canInsertEverywhere = false; @@ -67,12 +64,11 @@ public SubOptions canInsertEverywhere(Boolean canInsertEverywhere) { return this; } - /** + /** * Determines if signers can use \"Insert Everywhere\" when signing a document. * @return canInsertEverywhere - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Determines if signers can use \"Insert Everywhere\" when signing a document.") @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java b/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java index 4ca64bd..2120ea6 100644 --- a/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java +++ b/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java @@ -25,12 +25,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubSignatureRequestGroupedSigners.JSON_PROPERTY_SIGNERS, SubSignatureRequestGroupedSigners.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestGroupedSigners { public static final String JSON_PROPERTY_GROUP = "group"; private String group; @@ -77,12 +75,11 @@ public SubSignatureRequestGroupedSigners group(String group) { return this; } - /** + /** * The name of the group. * @return group - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the group.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -111,12 +108,11 @@ public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigne return this; } - /** + /** * 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. * @return signers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -137,12 +133,11 @@ public SubSignatureRequestGroupedSigners order(Integer order) { return this; } - /** + /** * The order the group is required to sign in. Use this instead of Signer-level `order`. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order the group is required to sign in. Use this instead of Signer-level `order`.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java b/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java index d65c54e..d1900a1 100644 --- a/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestSigner { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -121,12 +119,11 @@ public SubSignatureRequestSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubSignatureRequestSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubSignatureRequestSigner order(Integer order) { return this; } - /** + /** * The order the signer is required to sign in. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order the signer is required to sign in.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +194,11 @@ public SubSignatureRequestSigner pin(String pin) { return this; } - /** + /** * The 4- to 12-character access code that will secure this signer's signature page. * @return pin - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The 4- to 12-character access code that will secure this signer's signature page.") @JsonProperty(JSON_PROPERTY_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public SubSignatureRequestSigner smsPhoneNumber(String smsPhoneNumber) { return this; } - /** + /** * 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. * @return smsPhoneNumber - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +244,11 @@ public SubSignatureRequestSigner smsPhoneNumberType(SmsPhoneNumberTypeEnum smsPh return this; } - /** + /** * 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). * @return smsPhoneNumberType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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).") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java b/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java index 11a6a43..53222fa 100644 --- a/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestTemplateSigner { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -121,12 +119,11 @@ public SubSignatureRequestTemplateSigner role(String role) { return this; } - /** + /** * Must match an existing role in chosen Template(s). It's case-sensitive. * @return role - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing role in chosen Template(s). It's case-sensitive.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubSignatureRequestTemplateSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubSignatureRequestTemplateSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -199,12 +194,11 @@ public SubSignatureRequestTemplateSigner pin(String pin) { return this; } - /** + /** * The 4- to 12-character access code that will secure this signer's signature page. * @return pin - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The 4- to 12-character access code that will secure this signer's signature page.") @JsonProperty(JSON_PROPERTY_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public SubSignatureRequestTemplateSigner smsPhoneNumber(String smsPhoneNumber) { return this; } - /** + /** * 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. * @return smsPhoneNumber - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +244,11 @@ public SubSignatureRequestTemplateSigner smsPhoneNumberType(SmsPhoneNumberTypeEn return this; } - /** + /** * 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). * @return smsPhoneNumberType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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).") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubSigningOptions.java b/src/main/java/com/dropbox/sign/model/SubSigningOptions.java index e1bd357..4e2c33c 100644 --- a/src/main/java/com/dropbox/sign/model/SubSigningOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubSigningOptions.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. */ -@ApiModel(description = "This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings.") @JsonPropertyOrder({ SubSigningOptions.JSON_PROPERTY_DEFAULT_TYPE, SubSigningOptions.JSON_PROPERTY_DRAW, @@ -42,8 +39,8 @@ SubSigningOptions.JSON_PROPERTY_TYPE, SubSigningOptions.JSON_PROPERTY_UPLOAD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSigningOptions { /** * The default type shown (limited to the listed types) @@ -122,12 +119,11 @@ public SubSigningOptions defaultType(DefaultTypeEnum defaultType) { return this; } - /** + /** * The default type shown (limited to the listed types) * @return defaultType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The default type shown (limited to the listed types)") @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -148,12 +144,11 @@ public SubSigningOptions draw(Boolean draw) { return this; } - /** + /** * Allows drawing the signature * @return draw - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows drawing the signature") @JsonProperty(JSON_PROPERTY_DRAW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,12 +169,11 @@ public SubSigningOptions phone(Boolean phone) { return this; } - /** + /** * Allows using a smartphone to email the signature * @return phone - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows using a smartphone to email the signature") @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -200,12 +194,11 @@ public SubSigningOptions type(Boolean type) { return this; } - /** + /** * Allows typing the signature * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows typing the signature") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,12 +219,11 @@ public SubSigningOptions upload(Boolean upload) { return this; } - /** + /** * Allows uploading the signature * @return upload - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows uploading the signature") @JsonProperty(JSON_PROPERTY_UPLOAD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubTeamResponse.java b/src/main/java/com/dropbox/sign/model/SubTeamResponse.java index 25c9564..e653cbb 100644 --- a/src/main/java/com/dropbox/sign/model/SubTeamResponse.java +++ b/src/main/java/com/dropbox/sign/model/SubTeamResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubTeamResponse.JSON_PROPERTY_TEAM_ID, SubTeamResponse.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubTeamResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -70,12 +68,11 @@ public SubTeamResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public SubTeamResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubTemplateRole.java b/src/main/java/com/dropbox/sign/model/SubTemplateRole.java index 8661e02..081d88d 100644 --- a/src/main/java/com/dropbox/sign/model/SubTemplateRole.java +++ b/src/main/java/com/dropbox/sign/model/SubTemplateRole.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubTemplateRole.JSON_PROPERTY_NAME, SubTemplateRole.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubTemplateRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public SubTemplateRole name(String name) { return this; } - /** + /** * The role name of the signer that will be displayed when the template is used to create a signature request. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The role name of the signer that will be displayed when the template is used to create a signature request.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public SubTemplateRole order(Integer order) { return this; } - /** + /** * The order in which this signer role is required to sign. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order in which this signer role is required to sign.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java index 3ea654f..bc3ea96 100644 --- a/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ SubUnclaimedDraftSigner.JSON_PROPERTY_NAME, SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubUnclaimedDraftSigner { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -74,12 +72,11 @@ public SubUnclaimedDraftSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubUnclaimedDraftSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubUnclaimedDraftSigner order(Integer order) { return this; } - /** + /** * The order the signer is required to sign in. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order the signer is required to sign in.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java index 08c0425..2b7d02c 100644 --- a/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_NAME, SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubUnclaimedDraftTemplateSigner { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -74,12 +72,11 @@ public SubUnclaimedDraftTemplateSigner role(String role) { return this; } - /** + /** * Must match an existing role in chosen Template(s). * @return role - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing role in chosen Template(s).") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubUnclaimedDraftTemplateSigner name(String name) { return this; } - /** + /** * The name of the signer filling the role of `role`. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer filling the role of `role`.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubUnclaimedDraftTemplateSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer filling the role of `role`. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer filling the role of `role`.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java b/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java index 28fcf78..4f0a57b 100644 --- a/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. */ -@ApiModel(description = "An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more.") @JsonPropertyOrder({ SubWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, SubWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, @@ -52,8 +49,8 @@ SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2, SubWhiteLabelingOptions.JSON_PROPERTY_RESET_TO_DEFAULT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubWhiteLabelingOptions { public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; private String headerBackgroundColor = "#1A1A1A"; @@ -158,12 +155,11 @@ public SubWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColo return this; } - /** + /** * Get headerBackgroundColor * @return headerBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +180,11 @@ public SubWhiteLabelingOptions legalVersion(LegalVersionEnum legalVersion) { return this; } - /** + /** * Get legalVersion * @return legalVersion - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,12 +205,11 @@ public SubWhiteLabelingOptions linkColor(String linkColor) { return this; } - /** + /** * Get linkColor * @return linkColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LINK_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -236,12 +230,11 @@ public SubWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { return this; } - /** + /** * Get pageBackgroundColor * @return pageBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,12 +255,11 @@ public SubWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { return this; } - /** + /** * Get primaryButtonColor * @return primaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -288,12 +280,11 @@ public SubWhiteLabelingOptions primaryButtonColorHover(String primaryButtonColor return this; } - /** + /** * Get primaryButtonColorHover * @return primaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -314,12 +305,11 @@ public SubWhiteLabelingOptions primaryButtonTextColor(String primaryButtonTextCo return this; } - /** + /** * Get primaryButtonTextColor * @return primaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -340,12 +330,11 @@ public SubWhiteLabelingOptions primaryButtonTextColorHover(String primaryButtonT return this; } - /** + /** * Get primaryButtonTextColorHover * @return primaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -366,12 +355,11 @@ public SubWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) return this; } - /** + /** * Get secondaryButtonColor * @return secondaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -392,12 +380,11 @@ public SubWhiteLabelingOptions secondaryButtonColorHover(String secondaryButtonC return this; } - /** + /** * Get secondaryButtonColorHover * @return secondaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -418,12 +405,11 @@ public SubWhiteLabelingOptions secondaryButtonTextColor(String secondaryButtonTe return this; } - /** + /** * Get secondaryButtonTextColor * @return secondaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,12 +430,11 @@ public SubWhiteLabelingOptions secondaryButtonTextColorHover(String secondaryBut return this; } - /** + /** * Get secondaryButtonTextColorHover * @return secondaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +455,11 @@ public SubWhiteLabelingOptions textColor1(String textColor1) { return this; } - /** + /** * Get textColor1 * @return textColor1 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +480,11 @@ public SubWhiteLabelingOptions textColor2(String textColor2) { return this; } - /** + /** * Get textColor2 * @return textColor2 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +505,11 @@ public SubWhiteLabelingOptions resetToDefault(Boolean resetToDefault) { return this; } - /** + /** * Resets white labeling options to defaults. Only useful when updating an API App. * @return resetToDefault - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Resets white labeling options to defaults. Only useful when updating an API App.") @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java b/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java index 6ef48ef..d79399a 100644 --- a/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TeamAddMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, TeamAddMemberRequest.JSON_PROPERTY_ROLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamAddMemberRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -113,12 +111,11 @@ public TeamAddMemberRequest accountId(String accountId) { return this; } - /** + /** * `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. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`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.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +136,11 @@ public TeamAddMemberRequest emailAddress(String emailAddress) { return this; } - /** + /** * `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. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`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.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +161,11 @@ public TeamAddMemberRequest role(RoleEnum role) { return this; } - /** + /** * A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. * @return role - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java b/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java index 37586e1..cb5c87e 100644 --- a/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TeamCreateRequest.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamCreateRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name = "Untitled Team"; @@ -66,12 +64,11 @@ public TeamCreateRequest name(String name) { return this; } - /** + /** * The name of your Team. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of your Team.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java b/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java index 7bbe4ac..f6a7870 100644 --- a/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TeamGetInfoResponse.JSON_PROPERTY_TEAM, TeamGetInfoResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamGetInfoResponse { public static final String JSON_PROPERTY_TEAM = "team"; private TeamInfoResponse team; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamGetInfoResponse() { } @@ -74,14 +72,13 @@ public TeamGetInfoResponse team(TeamInfoResponse team) { return this; } - /** + /** * Get team * @return team - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TeamInfoResponse getTeam() { return team; @@ -89,7 +86,7 @@ public TeamInfoResponse getTeam() { @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeam(TeamInfoResponse team) { this.team = team; } @@ -108,12 +105,11 @@ public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamGetResponse.java b/src/main/java/com/dropbox/sign/model/TeamGetResponse.java index 710760f..f1670c1 100644 --- a/src/main/java/com/dropbox/sign/model/TeamGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TeamGetResponse.JSON_PROPERTY_TEAM, TeamGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamGetResponse { public static final String JSON_PROPERTY_TEAM = "team"; private TeamResponse team; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamGetResponse() { } @@ -74,14 +72,13 @@ public TeamGetResponse team(TeamResponse team) { return this; } - /** + /** * Get team * @return team - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TeamResponse getTeam() { return team; @@ -89,7 +86,7 @@ public TeamResponse getTeam() { @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeam(TeamResponse team) { this.team = team; } @@ -108,12 +105,11 @@ public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java b/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java index 1d7a58d..4a1e91a 100644 --- a/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ TeamInfoResponse.JSON_PROPERTY_NUM_MEMBERS, TeamInfoResponse.JSON_PROPERTY_NUM_SUB_TEAMS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInfoResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -83,12 +81,11 @@ public TeamInfoResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,12 +106,11 @@ public TeamInfoResponse teamParent(TeamParentResponse teamParent) { return this; } - /** + /** * Get teamParent * @return teamParent - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEAM_PARENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,12 +131,11 @@ public TeamInfoResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,12 +156,11 @@ public TeamInfoResponse numMembers(Integer numMembers) { return this; } - /** + /** * Number of members within a team * @return numMembers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of members within a team") @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -187,12 +181,11 @@ public TeamInfoResponse numSubTeams(Integer numSubTeams) { return this; } - /** + /** * Number of sub teams within a team * @return numSubTeams - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of sub teams within a team") @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java b/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java index a0d12b1..fb8aef5 100644 --- a/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ TeamInviteResponse.JSON_PROPERTY_REDEEMED_AT, TeamInviteResponse.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInviteResponse { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -86,12 +84,11 @@ public TeamInviteResponse emailAddress(String emailAddress) { return this; } - /** + /** * Email address of the user invited to this team. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Email address of the user invited to this team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -112,12 +109,11 @@ public TeamInviteResponse teamId(String teamId) { return this; } - /** + /** * Id of the team. * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Id of the team.") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,12 +134,11 @@ public TeamInviteResponse role(String role) { return this; } - /** + /** * Role of the user invited to this team. * @return role - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Role of the user invited to this team.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,12 +159,11 @@ public TeamInviteResponse sentAt(Integer sentAt) { return this; } - /** + /** * Timestamp when the invitation was sent. * @return sentAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation was sent.") @JsonProperty(JSON_PROPERTY_SENT_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,12 +184,11 @@ public TeamInviteResponse redeemedAt(Integer redeemedAt) { return this; } - /** + /** * Timestamp when the invitation was redeemed. * @return redeemedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation was redeemed.") @JsonProperty(JSON_PROPERTY_REDEEMED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +209,11 @@ public TeamInviteResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * Timestamp when the invitation is expiring. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation is expiring.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java b/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java index f919eb5..b509eb0 100644 --- a/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TeamInvitesResponse.JSON_PROPERTY_TEAM_INVITES, TeamInvitesResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInvitesResponse { public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; - private List teamInvites; + private List teamInvites = new ArrayList<>(); public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamInvitesResponse() { } @@ -82,14 +80,13 @@ public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem return this; } - /** + /** * Contains a list of team invites and their roles. * @return teamInvites - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list of team invites and their roles.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTeamInvites() { return teamInvites; @@ -97,7 +94,7 @@ public List getTeamInvites() { @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeamInvites(List teamInvites) { this.teamInvites = teamInvites; } @@ -116,12 +113,11 @@ public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java b/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java index 812f89d..888e9a8 100644 --- a/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TeamMemberResponse.JSON_PROPERTY_EMAIL_ADDRESS, TeamMemberResponse.JSON_PROPERTY_ROLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamMemberResponse { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public TeamMemberResponse accountId(String accountId) { return this; } - /** + /** * Account id of the team member. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Account id of the team member.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public TeamMemberResponse emailAddress(String emailAddress) { return this; } - /** + /** * Email address of the team member. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Email address of the team member.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public TeamMemberResponse role(String role) { return this; } - /** + /** * The specific role a member has on the team. * @return role - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The specific role a member has on the team.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java b/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java index 9792785..05fb9e4 100644 --- a/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ TeamMembersResponse.JSON_PROPERTY_LIST_INFO, TeamMembersResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamMembersResponse { public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; - private List teamMembers; + private List teamMembers = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamMembersResponse() { } @@ -87,14 +85,13 @@ public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem return this; } - /** + /** * Contains a list of team members and their roles for a specific team. * @return teamMembers - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list of team members and their roles for a specific team.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTeamMembers() { return teamMembers; @@ -102,7 +99,7 @@ public List getTeamMembers() { @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeamMembers(List teamMembers) { this.teamMembers = teamMembers; } @@ -113,14 +110,13 @@ public TeamMembersResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamParentResponse.java b/src/main/java/com/dropbox/sign/model/TeamParentResponse.java index 2dd2948..482b585 100644 --- a/src/main/java/com/dropbox/sign/model/TeamParentResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamParentResponse.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Information about the parent team if a team has one, set to `null` otherwise. */ -@ApiModel(description = "Information about the parent team if a team has one, set to `null` otherwise.") @JsonPropertyOrder({ TeamParentResponse.JSON_PROPERTY_TEAM_ID, TeamParentResponse.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamParentResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -71,12 +68,11 @@ public TeamParentResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TeamParentResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java b/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java index 2c1606d..9303f68 100644 --- a/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ TeamRemoveMemberRequest.JSON_PROPERTY_NEW_TEAM_ID, TeamRemoveMemberRequest.JSON_PROPERTY_NEW_ROLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamRemoveMemberRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -121,12 +119,11 @@ public TeamRemoveMemberRequest accountId(String accountId) { return this; } - /** + /** * **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +144,11 @@ public TeamRemoveMemberRequest emailAddress(String emailAddress) { return this; } - /** + /** * **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. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**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.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +169,11 @@ public TeamRemoveMemberRequest newOwnerEmailAddress(String newOwnerEmailAddress) return this; } - /** + /** * 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. * @return newOwnerEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +194,11 @@ public TeamRemoveMemberRequest newTeamId(String newTeamId) { return this; } - /** + /** * Id of the new Team. * @return newTeamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Id of the new Team.") @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public TeamRemoveMemberRequest newRole(NewRoleEnum newRole) { return this; } - /** + /** * A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. * @return newRole - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.") @JsonProperty(JSON_PROPERTY_NEW_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamResponse.java b/src/main/java/com/dropbox/sign/model/TeamResponse.java index fec132f..39a93c4 100644 --- a/src/main/java/com/dropbox/sign/model/TeamResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamResponse.java @@ -25,39 +25,36 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about your team and its members */ -@ApiModel(description = "Contains information about your team and its members") @JsonPropertyOrder({ TeamResponse.JSON_PROPERTY_NAME, TeamResponse.JSON_PROPERTY_ACCOUNTS, TeamResponse.JSON_PROPERTY_INVITED_ACCOUNTS, TeamResponse.JSON_PROPERTY_INVITED_EMAILS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamResponse { public static final String JSON_PROPERTY_NAME = "name"; private String name; public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - private List accounts; + private List accounts = null; public static final String JSON_PROPERTY_INVITED_ACCOUNTS = "invited_accounts"; - private List invitedAccounts; + private List invitedAccounts = null; public static final String JSON_PROPERTY_INVITED_EMAILS = "invited_emails"; - private List invitedEmails; + private List invitedEmails = null; public TeamResponse() { } @@ -82,12 +79,11 @@ public TeamResponse name(String name) { return this; } - /** + /** * The name of your Team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of your Team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,12 +112,11 @@ public TeamResponse addAccountsItem(AccountResponse accountsItem) { return this; } - /** + /** * Get accounts * @return accounts - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,12 +145,11 @@ public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) return this; } - /** + /** * 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`. * @return invitedAccounts - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +178,11 @@ public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { return this; } - /** + /** * A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. * @return invitedEmails - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java b/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java index 7be230b..b8c7190 100644 --- a/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ TeamSubTeamsResponse.JSON_PROPERTY_LIST_INFO, TeamSubTeamsResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamSubTeamsResponse { public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; - private List subTeams; + private List subTeams = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamSubTeamsResponse() { } @@ -87,14 +85,13 @@ public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { return this; } - /** + /** * Contains a list with sub teams. * @return subTeams - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list with sub teams.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSubTeams() { return subTeams; @@ -102,7 +99,7 @@ public List getSubTeams() { @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSubTeams(List subTeams) { this.subTeams = subTeams; } @@ -113,14 +110,13 @@ public TeamSubTeamsResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java b/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java index 3d38e8a..aa668a2 100644 --- a/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TeamUpdateRequest.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamUpdateRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -66,12 +64,11 @@ public TeamUpdateRequest name(String name) { return this; } - /** + /** * The name of your Team. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of your Team.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java b/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java index 4acfa87..dc2bf3a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TemplateAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS, TemplateAddUserRequest.JSON_PROPERTY_SKIP_NOTIFICATION }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateAddUserRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public TemplateAddUserRequest accountId(String accountId) { return this; } - /** + /** * The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public TemplateAddUserRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public TemplateAddUserRequest skipNotification(Boolean skipNotification) { return this; } - /** + /** * If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. * @return skipNotification - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java index f518478..8c6b2ba 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java @@ -35,12 +35,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -74,17 +72,17 @@ TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TITLE, TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; private Boolean allowCcs = true; @@ -93,10 +91,10 @@ public class TemplateCreateEmbeddedDraftRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -111,22 +109,22 @@ public class TemplateCreateEmbeddedDraftRequest { private Boolean forceSubjectMessage = false; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields; + private List mergeFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; private Boolean showPreview = false; @@ -135,7 +133,7 @@ public class TemplateCreateEmbeddedDraftRequest { private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles; + private List signerRoles = null; public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; private Boolean skipMeNow = false; @@ -175,12 +173,11 @@ public TemplateCreateEmbeddedDraftRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +206,11 @@ public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,12 +239,11 @@ public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,12 +264,11 @@ public TemplateCreateEmbeddedDraftRequest allowCcs(Boolean allowCcs) { return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. * @return allowCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +289,11 @@ public TemplateCreateEmbeddedDraftRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * 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. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -329,12 +322,11 @@ public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attac return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -363,12 +355,11 @@ public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -389,12 +380,11 @@ public TemplateCreateEmbeddedDraftRequest editorOptions(SubEditorOptions editorO return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -415,12 +405,11 @@ public TemplateCreateEmbeddedDraftRequest fieldOptions(SubFieldOptions fieldOpti return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +430,11 @@ public TemplateCreateEmbeddedDraftRequest forceSignerRoles(Boolean forceSignerRo return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -467,12 +455,11 @@ public TemplateCreateEmbeddedDraftRequest forceSubjectMessage(Boolean forceSubje return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -501,12 +488,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem(SubFormFieldGro return this; } - /** + /** * 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`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -535,12 +521,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem(SubFormFieldRule return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -569,12 +554,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem(SubFormFi return this; } - /** + /** * 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` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -603,12 +587,11 @@ public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField merge return this; } - /** + /** * 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. * @return mergeFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -629,12 +612,11 @@ public TemplateCreateEmbeddedDraftRequest message(String message) { return this; } - /** + /** * The default template email message. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -663,12 +645,11 @@ public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object met return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -689,12 +670,11 @@ public TemplateCreateEmbeddedDraftRequest showPreview(Boolean showPreview) { return this; } - /** + /** * 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. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -715,12 +695,11 @@ public TemplateCreateEmbeddedDraftRequest showProgressStepper(Boolean showProgre return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -749,12 +728,11 @@ public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole sig return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -775,12 +753,11 @@ public TemplateCreateEmbeddedDraftRequest skipMeNow(Boolean skipMeNow) { return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -801,12 +778,11 @@ public TemplateCreateEmbeddedDraftRequest subject(String subject) { return this; } - /** + /** * The template title (alias). * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The template title (alias).") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -827,12 +803,11 @@ public TemplateCreateEmbeddedDraftRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,12 +828,11 @@ public TemplateCreateEmbeddedDraftRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -879,12 +853,11 @@ public TemplateCreateEmbeddedDraftRequest usePreexistingFields(Boolean usePreexi return this; } - /** + /** * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java index 6acac5b..e3e7300 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_TEMPLATE, TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateCreateEmbeddedDraftResponseTemplate template; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateCreateEmbeddedDraftResponse() { } @@ -74,14 +72,13 @@ public TemplateCreateEmbeddedDraftResponse template(TemplateCreateEmbeddedDraftR return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateCreateEmbeddedDraftResponseTemplate template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warni return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java index 235a381..f9c0286 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java @@ -25,27 +25,24 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Template object with parameters: `template_id`, `edit_url`, `expires_at`. */ -@ApiModel(description = "Template object with parameters: `template_id`, `edit_url`, `expires_at`.") @JsonPropertyOrder({ TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EDIT_URL, TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EXPIRES_AT, TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -57,7 +54,8 @@ public class TemplateCreateEmbeddedDraftResponseTemplate { private Integer expiresAt; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + @Deprecated + private List warnings = null; public TemplateCreateEmbeddedDraftResponseTemplate() { } @@ -82,12 +80,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate templateId(String templateId) return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate editUrl(String editUrl) { return this; } - /** + /** * Link to edit the template. * @return editUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Link to edit the template.") @JsonProperty(JSON_PROPERTY_EDIT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate expiresAt(Integer expiresAt) return this; } - /** + /** * When the link expires. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -155,6 +150,7 @@ public void setExpiresAt(Integer expiresAt) { } + @Deprecated public TemplateCreateEmbeddedDraftResponseTemplate warnings(List warnings) { this.warnings = warnings; return this; @@ -168,14 +164,13 @@ public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem(WarningRespon return this; } - /** + /** * A list of warnings. * @return warnings * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,6 +179,7 @@ public List getWarnings() { } + @Deprecated @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWarnings(List warnings) { diff --git a/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java b/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java index 32fd982..b1ff55f 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java @@ -34,12 +34,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -66,8 +64,8 @@ TemplateCreateRequest.JSON_PROPERTY_TITLE, TemplateCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateRequest { public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; private List formFieldsPerDocument = new ArrayList<>(); @@ -76,19 +74,19 @@ public class TemplateCreateRequest { private List signerRoles = new ArrayList<>(); public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -97,19 +95,19 @@ public class TemplateCreateRequest { private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields; + private List mergeFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SUBJECT = "subject"; private String subject; @@ -154,12 +152,11 @@ public TemplateCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocume return this; } - /** + /** * 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` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -188,12 +185,11 @@ public TemplateCreateRequest addSignerRolesItem(SubTemplateRole signerRolesItem) return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -222,12 +218,11 @@ public TemplateCreateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +251,11 @@ public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -282,12 +276,11 @@ public TemplateCreateRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * 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. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +309,11 @@ public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,12 +342,11 @@ public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +367,11 @@ public TemplateCreateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -402,12 +392,11 @@ public TemplateCreateRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -436,12 +425,11 @@ public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldG return this; } - /** + /** * 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`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +458,11 @@ public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRul return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -504,12 +491,11 @@ public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { return this; } - /** + /** * 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. * @return mergeFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +516,11 @@ public TemplateCreateRequest message(String message) { return this; } - /** + /** * The default template email message. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -564,12 +549,11 @@ public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -590,12 +574,11 @@ public TemplateCreateRequest subject(String subject) { return this; } - /** + /** * The template title (alias). * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The template title (alias).") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,12 +599,11 @@ public TemplateCreateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,12 +624,11 @@ public TemplateCreateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -668,12 +649,11 @@ public TemplateCreateRequest usePreexistingFields(Boolean usePreexistingFields) return this; } - /** + /** * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java b/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java index 45b0b7d..5d7d2c2 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TemplateCreateResponse.JSON_PROPERTY_TEMPLATE, TemplateCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateCreateResponseTemplate template; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateCreateResponse() { } @@ -74,14 +72,13 @@ public TemplateCreateResponse template(TemplateCreateResponseTemplate template) return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateCreateResponseTemplate getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateCreateResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateCreateResponseTemplate template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java b/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java index 87c39c0..6d668fd 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Template object with parameters: `template_id`. */ -@ApiModel(description = "Template object with parameters: `template_id`.") @JsonPropertyOrder({ TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -67,12 +64,11 @@ public TemplateCreateResponseTemplate templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java index 92bc44f..f660ab2 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateEditResponse { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -66,14 +64,13 @@ public TemplateEditResponse templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTemplateId() { return templateId; @@ -81,7 +78,7 @@ public String getTemplateId() { @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplateId(String templateId) { this.templateId = templateId; } diff --git a/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java b/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java index df15e55..30a55e8 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TemplateGetResponse.JSON_PROPERTY_TEMPLATE, TemplateGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateGetResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateResponse template; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateGetResponse() { } @@ -74,14 +72,13 @@ public TemplateGetResponse template(TemplateResponse template) { return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateResponse getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateResponse getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateResponse template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateListResponse.java b/src/main/java/com/dropbox/sign/model/TemplateListResponse.java index 54779e1..d3949c6 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateListResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ TemplateListResponse.JSON_PROPERTY_LIST_INFO, TemplateListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateListResponse { public static final String JSON_PROPERTY_TEMPLATES = "templates"; - private List templates; + private List templates = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateListResponse() { } @@ -87,14 +85,13 @@ public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { return this; } - /** + /** * List of templates that the API caller has access to. * @return templates - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "List of templates that the API caller has access to.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTemplates() { return templates; @@ -102,7 +99,7 @@ public List getTemplates() { @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplates(List templates) { this.templates = templates; } @@ -113,14 +110,13 @@ public TemplateListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java b/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java index aece8d1..0d9c88e 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ TemplateRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, TemplateRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateRemoveUserRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -70,12 +68,11 @@ public TemplateRemoveUserRequest accountId(String accountId) { return this; } - /** + /** * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public TemplateRemoveUserRequest emailAddress(String emailAddress) { return this; } - /** + /** * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponse.java b/src/main/java/com/dropbox/sign/model/TemplateResponse.java index 96c2893..577975b 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponse.java @@ -30,19 +30,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the templates you and your team have created. */ -@ApiModel(description = "Contains information about the templates you and your team have created.") @JsonPropertyOrder({ TemplateResponse.JSON_PROPERTY_TEMPLATE_ID, TemplateResponse.JSON_PROPERTY_TITLE, @@ -60,8 +57,8 @@ TemplateResponse.JSON_PROPERTY_NAMED_FORM_FIELDS, TemplateResponse.JSON_PROPERTY_ACCOUNTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponse { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -91,22 +88,24 @@ public class TemplateResponse { private Object metadata; public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles; + private List signerRoles = null; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_DOCUMENTS = "documents"; - private List documents; + private List documents = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + @Deprecated + private List customFields = null; public static final String JSON_PROPERTY_NAMED_FORM_FIELDS = "named_form_fields"; - private List namedFormFields; + @Deprecated + private List namedFormFields = null; public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - private List accounts; + private List accounts = null; public TemplateResponse() { } @@ -131,12 +130,11 @@ public TemplateResponse templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +155,11 @@ public TemplateResponse title(String title) { return this; } - /** + /** * 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. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -183,12 +180,11 @@ public TemplateResponse message(String message) { return this; } - /** + /** * 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. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,12 +205,11 @@ public TemplateResponse updatedAt(Integer updatedAt) { return this; } - /** + /** * Time the template was last updated. * @return updatedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time the template was last updated.") @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +230,11 @@ public TemplateResponse isEmbedded(Boolean isEmbedded) { return this; } - /** + /** * `true` if this template was created using an embedded flow, `false` if it was created on our website. * @return isEmbedded - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`true` if this template was created using an embedded flow, `false` if it was created on our website.") @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,12 +255,11 @@ public TemplateResponse isCreator(Boolean isCreator) { return this; } - /** + /** * `true` if you are the owner of this template, `false` if it's been shared with you by a team member. * @return isCreator - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`true` if you are the owner of this template, `false` if it's been shared with you by a team member.") @JsonProperty(JSON_PROPERTY_IS_CREATOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -287,12 +280,11 @@ public TemplateResponse canEdit(Boolean canEdit) { return this; } - /** + /** * Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). * @return canEdit - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).") @JsonProperty(JSON_PROPERTY_CAN_EDIT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -313,12 +305,11 @@ public TemplateResponse isLocked(Boolean isLocked) { return this; } - /** + /** * 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. * @return isLocked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -339,12 +330,11 @@ public TemplateResponse metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the template. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the template.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +363,11 @@ public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRole return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,12 +396,11 @@ public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { return this; } - /** + /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +429,11 @@ public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) return this; } - /** + /** * An array describing each document associated with this Template. Includes form field data for each document. * @return documents - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array describing each document associated with this Template. Includes form field data for each document.") @JsonProperty(JSON_PROPERTY_DOCUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,6 +449,7 @@ public void setDocuments(List documents) { } + @Deprecated public TemplateResponse customFields(List customFields) { this.customFields = customFields; return this; @@ -475,14 +463,13 @@ public TemplateResponse addCustomFieldsItem(TemplateResponseDocumentCustomFieldB return this; } - /** + /** * Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. * @return customFields * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -491,6 +478,7 @@ public List getCustomFields() { } + @Deprecated @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomFields(List customFields) { @@ -498,6 +486,7 @@ public void setCustomFields(List custom } + @Deprecated public TemplateResponse namedFormFields(List namedFormFields) { this.namedFormFields = namedFormFields; return this; @@ -511,14 +500,13 @@ public TemplateResponse addNamedFormFieldsItem(TemplateResponseDocumentFormField return this; } - /** + /** * Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. * @return namedFormFields * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -527,6 +515,7 @@ public List getNamedFormFields() { } + @Deprecated @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamedFormFields(List namedFormFields) { @@ -547,12 +536,11 @@ public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { return this; } - /** + /** * An array of the Accounts that can use this Template. * @return accounts - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the Accounts that can use this Template.") @JsonProperty(JSON_PROPERTY_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java b/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java index bdb82f7..53f50dd 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -43,8 +41,8 @@ TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HF, TemplateResponseAccount.JSON_PROPERTY_QUOTAS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseAccount { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -87,12 +85,11 @@ public TemplateResponseAccount accountId(String accountId) { return this; } - /** + /** * The id of the Account. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Account.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +110,11 @@ public TemplateResponseAccount emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +135,11 @@ public TemplateResponseAccount isLocked(Boolean isLocked) { return this; } - /** + /** * Returns `true` if the user has been locked out of their account by a team admin. * @return isLocked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has been locked out of their account by a team admin.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +160,11 @@ public TemplateResponseAccount isPaidHs(Boolean isPaidHs) { return this; } - /** + /** * Returns `true` if the user has a paid Dropbox Sign account. * @return isPaidHs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +185,11 @@ public TemplateResponseAccount isPaidHf(Boolean isPaidHf) { return this; } - /** + /** * Returns `true` if the user has a paid HelloFax account. * @return isPaidHf - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid HelloFax account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +210,11 @@ public TemplateResponseAccount quotas(TemplateResponseAccountQuota quotas) { return this; } - /** + /** * Get quotas * @return quotas - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUOTAS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java b/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java index 4d3e0b2..78b1f58 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. */ -@ApiModel(description = "An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") @JsonPropertyOrder({ TemplateResponseAccountQuota.JSON_PROPERTY_TEMPLATES_LEFT, TemplateResponseAccountQuota.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, TemplateResponseAccountQuota.JSON_PROPERTY_DOCUMENTS_LEFT, TemplateResponseAccountQuota.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseAccountQuota { public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; private Integer templatesLeft; @@ -79,12 +76,11 @@ public TemplateResponseAccountQuota templatesLeft(Integer templatesLeft) { return this; } - /** + /** * API templates remaining. * @return templatesLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API templates remaining.") @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public TemplateResponseAccountQuota apiSignatureRequestsLeft(Integer apiSignatur return this; } - /** + /** * API signature requests remaining. * @return apiSignatureRequestsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API signature requests remaining.") @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public TemplateResponseAccountQuota documentsLeft(Integer documentsLeft) { return this; } - /** + /** * Signature requests remaining. * @return documentsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature requests remaining.") @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public TemplateResponseAccountQuota smsVerificationsLeft(Integer smsVerification return this; } - /** + /** * SMS verifications remaining. * @return smsVerificationsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "SMS verifications remaining.") @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java b/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java index 9654ebd..4ed3eb9 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TemplateResponseCCRole.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseCCRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -66,12 +64,11 @@ public TemplateResponseCCRole name(String name) { return this; } - /** + /** * The name of the Role. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Role.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java index f8a399d..040c68c 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -48,8 +46,8 @@ TemplateResponseDocument.JSON_PROPERTY_CUSTOM_FIELDS, TemplateResponseDocument.JSON_PROPERTY_STATIC_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocument { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -58,16 +56,16 @@ public class TemplateResponseDocument { private Integer index; public static final String JSON_PROPERTY_FIELD_GROUPS = "field_groups"; - private List fieldGroups; + private List fieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; - private List formFields; + private List formFields = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_STATIC_FIELDS = "static_fields"; - private List staticFields; + private List staticFields = null; public TemplateResponseDocument() { } @@ -92,12 +90,11 @@ public TemplateResponseDocument name(String name) { return this; } - /** + /** * Name of the associated file. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Name of the associated file.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,12 +115,11 @@ public TemplateResponseDocument index(Integer index) { return this; } - /** + /** * Document ordering, the lowest index is displayed first and the highest last (0-based indexing). * @return index - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Document ordering, the lowest index is displayed first and the highest last (0-based indexing).") @JsonProperty(JSON_PROPERTY_INDEX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -152,12 +148,11 @@ public TemplateResponseDocument addFieldGroupsItem(TemplateResponseDocumentField return this; } - /** + /** * An array of Form Field Group objects. * @return fieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field Group objects.") @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +181,11 @@ public TemplateResponseDocument addFormFieldsItem(TemplateResponseDocumentFormFi return this; } - /** + /** * An array of Form Field objects containing the name and type of each named field. * @return formFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field objects containing the name and type of each named field.") @JsonProperty(JSON_PROPERTY_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,12 +214,11 @@ public TemplateResponseDocument addCustomFieldsItem(TemplateResponseDocumentCust return this; } - /** + /** * An array of Form Field objects containing the name and type of each named field. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field objects containing the name and type of each named field.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -254,12 +247,11 @@ public TemplateResponseDocument addStaticFieldsItem(TemplateResponseDocumentStat return this; } - /** + /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. * @return staticFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java index 692f0b6..4797afd 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of Form Field objects containing the name and type of each named field. */ -@ApiModel(description = "An array of Form Field objects containing the name and type of each named field.") @JsonPropertyOrder({ TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_TYPE, TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_API_ID, @@ -50,8 +47,11 @@ TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_REQUIRED, TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "checkbox"), @@ -112,12 +112,11 @@ public TemplateResponseDocumentCustomFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -138,12 +137,11 @@ public TemplateResponseDocumentCustomFieldBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,12 +162,11 @@ public TemplateResponseDocumentCustomFieldBase name(String name) { return this; } - /** + /** * The name of the Custom Field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Custom Field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,13 +186,16 @@ public TemplateResponseDocumentCustomFieldBase signer(String signer) { this.signer = signer; return this; } + public TemplateResponseDocumentCustomFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). * @return signer - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,18 +210,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public TemplateResponseDocumentCustomFieldBase x(Integer x) { this.x = x; return this; } - /** + /** * The horizontal offset in pixels for this form field. * @return x - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +245,11 @@ public TemplateResponseDocumentCustomFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this form field. * @return y - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,12 +270,11 @@ public TemplateResponseDocumentCustomFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this form field. * @return width - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this form field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,12 +295,11 @@ public TemplateResponseDocumentCustomFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this form field. * @return height - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this form field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -320,12 +320,11 @@ public TemplateResponseDocumentCustomFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -346,12 +345,11 @@ public TemplateResponseDocumentCustomFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null`. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null`.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java index 2d0eb07..353dd6a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentCustomFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentCustomFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentCustomFieldCheckbox type(String type) { return this; } - /** + /** * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java index 3d04f88..e9c2932 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java @@ -27,19 +27,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentCustomFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentCustomFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_TYPE, TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, @@ -47,8 +44,11 @@ TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_FONT_FAMILY }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { @@ -90,12 +90,11 @@ public TemplateResponseDocumentCustomFieldText type(String type) { return this; } - /** + /** * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -116,12 +115,11 @@ public TemplateResponseDocumentCustomFieldText avgTextLength(TemplateResponseFie return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +140,11 @@ public TemplateResponseDocumentCustomFieldText isMultiline(Boolean isMultiline) return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +165,11 @@ public TemplateResponseDocumentCustomFieldText originalFontSize(Integer original return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +190,11 @@ public TemplateResponseDocumentCustomFieldText fontFamily(String fontFamily) { return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java index 29b8121..3e724af 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TemplateResponseDocumentFieldGroup.JSON_PROPERTY_NAME, TemplateResponseDocumentFieldGroup.JSON_PROPERTY_RULE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocumentFieldGroup { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -71,12 +69,11 @@ public TemplateResponseDocumentFieldGroup name(String name) { return this; } - /** + /** * The name of the form field group. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the form field group.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +94,11 @@ public TemplateResponseDocumentFieldGroup rule(TemplateResponseDocumentFieldGrou return this; } - /** + /** * Get rule * @return rule - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_RULE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java index eb82d06..65aa63b 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). */ -@ApiModel(description = "The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping).") @JsonPropertyOrder({ TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_REQUIREMENT, TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_GROUP_LABEL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocumentFieldGroupRule { public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; private String requirement; @@ -71,12 +68,11 @@ public TemplateResponseDocumentFieldGroupRule requirement(String requirement) { return this; } - /** + /** * 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. * @return requirement - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_REQUIREMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TemplateResponseDocumentFieldGroupRule groupLabel(String groupLabel) { return this; } - /** + /** * Name of the group * @return groupLabel - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Name of the group") @JsonProperty(JSON_PROPERTY_GROUP_LABEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java index 1315770..cbef92e 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array of Form Field objects containing the name and type of each named field. */ -@ApiModel(description = "An array of Form Field objects containing the name and type of each named field.") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_TYPE, TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_API_ID, @@ -50,8 +47,11 @@ TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_REQUIRED, TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), @@ -118,12 +118,11 @@ public TemplateResponseDocumentFormFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -144,12 +143,11 @@ public TemplateResponseDocumentFormFieldBase apiId(String apiId) { return this; } - /** + /** * A unique id for the form field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A unique id for the form field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,12 +168,11 @@ public TemplateResponseDocumentFormFieldBase name(String name) { return this; } - /** + /** * The name of the form field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the form field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,13 +192,16 @@ public TemplateResponseDocumentFormFieldBase signer(String signer) { this.signer = signer; return this; } + public TemplateResponseDocumentFormFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The signer of the Form Field. * @return signer - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The signer of the Form Field.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,18 +216,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public TemplateResponseDocumentFormFieldBase x(Integer x) { this.x = x; return this; } - /** + /** * The horizontal offset in pixels for this form field. * @return x - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,12 +251,11 @@ public TemplateResponseDocumentFormFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this form field. * @return y - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +276,11 @@ public TemplateResponseDocumentFormFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this form field. * @return width - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this form field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,12 +301,11 @@ public TemplateResponseDocumentFormFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this form field. * @return height - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this form field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,12 +326,11 @@ public TemplateResponseDocumentFormFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -352,12 +351,11 @@ public TemplateResponseDocumentFormFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java index 6cb6e72..8354a7a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldCheckbox type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java index 38bc2e0..2029911 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldDateSigned type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java index 03e40ea..ca033ad 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldDropdown type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java index 1ec973c..acaa254 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java @@ -27,19 +27,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_TYPE, TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_AVG_TEXT_LENGTH, @@ -47,8 +44,11 @@ TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_ORIGINAL_FONT_SIZE, TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_FONT_FAMILY }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { @@ -90,12 +90,11 @@ public TemplateResponseDocumentFormFieldHyperlink type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -116,12 +115,11 @@ public TemplateResponseDocumentFormFieldHyperlink avgTextLength(TemplateResponse return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +140,11 @@ public TemplateResponseDocumentFormFieldHyperlink isMultiline(Boolean isMultilin return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +165,11 @@ public TemplateResponseDocumentFormFieldHyperlink originalFontSize(Integer origi return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +190,11 @@ public TemplateResponseDocumentFormFieldHyperlink fontFamily(String fontFamily) return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java index ea21c91..749d701 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldInitials type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java index 49aa638..aa71ef5 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldRadio type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java index e76bece..9ff154a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldSignature type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java index 1175d24..db21928 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java @@ -27,19 +27,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldText.JSON_PROPERTY_TYPE, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, @@ -48,8 +45,11 @@ TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { @@ -145,12 +145,11 @@ public TemplateResponseDocumentFormFieldText type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,12 +170,11 @@ public TemplateResponseDocumentFormFieldText avgTextLength(TemplateResponseField return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -197,12 +195,11 @@ public TemplateResponseDocumentFormFieldText isMultiline(Boolean isMultiline) { return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,12 +220,11 @@ public TemplateResponseDocumentFormFieldText originalFontSize(Integer originalFo return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,12 +245,11 @@ public TemplateResponseDocumentFormFieldText fontFamily(String fontFamily) { return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +270,11 @@ public TemplateResponseDocumentFormFieldText validationType(ValidationTypeEnum v return this; } - /** + /** * 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. * @return validationType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java index 65aa3c5..4e1e982 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. */ -@ApiModel(description = "An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_TYPE, TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_API_ID, @@ -50,8 +47,11 @@ TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_REQUIRED, TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), @@ -118,12 +118,11 @@ public TemplateResponseDocumentStaticFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -144,12 +143,11 @@ public TemplateResponseDocumentStaticFieldBase apiId(String apiId) { return this; } - /** + /** * A unique id for the static field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A unique id for the static field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,12 +168,11 @@ public TemplateResponseDocumentStaticFieldBase name(String name) { return this; } - /** + /** * The name of the static field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the static field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +193,11 @@ public TemplateResponseDocumentStaticFieldBase signer(String signer) { return this; } - /** + /** * The signer of the Static Field. * @return signer - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The signer of the Static Field.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -222,12 +218,11 @@ public TemplateResponseDocumentStaticFieldBase x(Integer x) { return this; } - /** + /** * The horizontal offset in pixels for this static field. * @return x - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this static field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,12 +243,11 @@ public TemplateResponseDocumentStaticFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this static field. * @return y - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this static field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +268,11 @@ public TemplateResponseDocumentStaticFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this static field. * @return width - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this static field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,12 +293,11 @@ public TemplateResponseDocumentStaticFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this static field. * @return height - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this static field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,12 +318,11 @@ public TemplateResponseDocumentStaticFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -352,12 +343,11 @@ public TemplateResponseDocumentStaticFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null`. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null`.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java index aaac519..d23f853 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldCheckbox type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java index 860bff8..8a19f3c 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldDateSigned type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java index f30dcac..171417e 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldDropdown type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java index c245d45..925996d 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldHyperlink type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java index 59b7d5e..15e4b07 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldInitials type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java index 61f43e0..73f1fd8 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldRadio type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java index 58e90b5..6e472ec 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldSignature type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java index 96f7f1b..8778199 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldText type(String type) { return this; } - /** + /** * 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` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java b/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java index 5cc49e5..38f5acd 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Average text length in this field. */ -@ApiModel(description = "Average text length in this field.") @JsonPropertyOrder({ TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_LINES, TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_CHARS_PER_LINE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseFieldAvgTextLength { public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; private Integer numLines; @@ -71,12 +68,11 @@ public TemplateResponseFieldAvgTextLength numLines(Integer numLines) { return this; } - /** + /** * Number of lines. * @return numLines - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of lines.") @JsonProperty(JSON_PROPERTY_NUM_LINES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TemplateResponseFieldAvgTextLength numCharsPerLine(Integer numCharsPerLin return this; } - /** + /** * Number of characters per line. * @return numCharsPerLine - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of characters per line.") @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java b/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java index 4ab15af..45d786a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ TemplateResponseSignerRole.JSON_PROPERTY_NAME, TemplateResponseSignerRole.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseSignerRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public TemplateResponseSignerRole name(String name) { return this; } - /** + /** * The name of the Role. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Role.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public TemplateResponseSignerRole order(Integer order) { return this; } - /** + /** * If signer order is assigned this is the 0-based index for this role. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "If signer order is assigned this is the 0-based index for this role.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java index 0635c97..432b368 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java @@ -25,12 +25,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -45,17 +43,17 @@ TemplateUpdateFilesRequest.JSON_PROPERTY_SUBJECT, TemplateUpdateFilesRequest.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; @@ -89,12 +87,11 @@ public TemplateUpdateFilesRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to update this template. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app you're using to update this template.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,12 +120,11 @@ public TemplateUpdateFilesRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +153,11 @@ public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -183,12 +178,11 @@ public TemplateUpdateFilesRequest message(String message) { return this; } - /** + /** * The new default template email message. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,12 +203,11 @@ public TemplateUpdateFilesRequest subject(String subject) { return this; } - /** + /** * The new default template email subject. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new default template email subject.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +228,11 @@ public TemplateUpdateFilesRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java index e6be4c7..862c431 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ @JsonPropertyOrder({ TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateUpdateFilesResponseTemplate template; @@ -67,14 +65,13 @@ public TemplateUpdateFilesResponse template(TemplateUpdateFilesResponseTemplate return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateUpdateFilesResponseTemplate getTemplate() { return template; @@ -82,7 +79,7 @@ public TemplateUpdateFilesResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateUpdateFilesResponseTemplate template) { this.template = template; } diff --git a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java index 9b80dd3..19dea91 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java +++ b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java @@ -25,31 +25,29 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * Contains template id */ -@ApiModel(description = "Contains template id") @JsonPropertyOrder({ TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + @Deprecated + private List warnings = null; public TemplateUpdateFilesResponseTemplate() { } @@ -74,12 +72,11 @@ public TemplateUpdateFilesResponseTemplate templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -95,6 +92,7 @@ public void setTemplateId(String templateId) { } + @Deprecated public TemplateUpdateFilesResponseTemplate warnings(List warnings) { this.warnings = warnings; return this; @@ -108,14 +106,13 @@ public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warni return this; } - /** + /** * A list of warnings. * @return warnings * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,6 +121,7 @@ public List getWarnings() { } + @Deprecated @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWarnings(List warnings) { diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java index a1fdaa9..5dd37a3 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java @@ -36,19 +36,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * */ -@ApiModel(description = "") @JsonPropertyOrder({ UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, @@ -87,8 +84,8 @@ UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateEmbeddedRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -97,10 +94,10 @@ public class UnclaimedDraftCreateEmbeddedRequest { private String requesterEmailAddress; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; private Boolean allowCcs = true; @@ -112,13 +109,13 @@ public class UnclaimedDraftCreateEmbeddedRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -133,13 +130,13 @@ public class UnclaimedDraftCreateEmbeddedRequest { private Boolean forceSubjectMessage = false; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; @@ -154,7 +151,7 @@ public class UnclaimedDraftCreateEmbeddedRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; private String requestingRedirectUrl; @@ -166,7 +163,7 @@ public class UnclaimedDraftCreateEmbeddedRequest { private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -256,12 +253,11 @@ public UnclaimedDraftCreateEmbeddedRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -282,12 +278,11 @@ public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress(String requeste return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -316,12 +311,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,12 +344,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +369,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowCcs(Boolean allowCcs) { return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * @return allowCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -402,12 +394,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +419,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowReassign(Boolean allowReassign) return this; } - /** + /** * 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. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,12 +452,11 @@ public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment atta return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +485,11 @@ public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmai return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +518,11 @@ public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem(SubCustomField cu return this; } - /** + /** * 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. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,12 +543,11 @@ public UnclaimedDraftCreateEmbeddedRequest editorOptions(SubEditorOptions editor return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -582,12 +568,11 @@ public UnclaimedDraftCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOpt return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -608,12 +593,11 @@ public UnclaimedDraftCreateEmbeddedRequest forceSignerPage(Boolean forceSignerPa return this; } - /** + /** * Provide users the ability to review/edit the signers. * @return forceSignerPage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the signers.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -634,12 +618,11 @@ public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage(Boolean forceSubj return this; } - /** + /** * Provide users the ability to review/edit the subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -668,12 +651,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGr return this; } - /** + /** * 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`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -702,12 +684,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRul return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -736,12 +717,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormF return this; } - /** + /** * 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` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -762,12 +742,11 @@ public UnclaimedDraftCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * 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. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -788,12 +767,11 @@ public UnclaimedDraftCreateEmbeddedRequest holdRequest(Boolean holdRequest) { return this; } - /** + /** * 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`. * @return holdRequest - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -814,12 +792,11 @@ public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning(Boolean isForEmb return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. * @return isForEmbeddedSigning - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,12 +817,11 @@ public UnclaimedDraftCreateEmbeddedRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -874,12 +850,11 @@ public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object me return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -900,12 +875,11 @@ public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl(String requesti return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -926,12 +900,11 @@ public UnclaimedDraftCreateEmbeddedRequest showPreview(Boolean showPreview) { return this; } - /** + /** * 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. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -952,12 +925,11 @@ public UnclaimedDraftCreateEmbeddedRequest showProgressStepper(Boolean showProgr return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -986,12 +958,11 @@ public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigne return this; } - /** + /** * Add Signers to your Unclaimed Draft Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Unclaimed Draft Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1012,12 +983,11 @@ public UnclaimedDraftCreateEmbeddedRequest signingOptions(SubSigningOptions sign return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1038,12 +1008,11 @@ public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl(String signingRedi return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1064,12 +1033,11 @@ public UnclaimedDraftCreateEmbeddedRequest skipMeNow(Boolean skipMeNow) { return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1090,12 +1058,11 @@ public UnclaimedDraftCreateEmbeddedRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1116,12 +1083,11 @@ public UnclaimedDraftCreateEmbeddedRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1142,12 +1108,11 @@ public UnclaimedDraftCreateEmbeddedRequest type(TypeEnum type) { return this; } - /** + /** * 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. * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1168,12 +1133,11 @@ public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields(Boolean usePreex return this; } - /** + /** * 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. * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1194,12 +1158,11 @@ public UnclaimedDraftCreateEmbeddedRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * 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. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1220,12 +1183,11 @@ public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields(Boolean popula return this; } - /** + /** * 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. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1246,12 +1208,11 @@ public UnclaimedDraftCreateEmbeddedRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java index 2412383..7af776e 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java @@ -33,12 +33,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -77,8 +75,8 @@ UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_CCS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -96,10 +94,10 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -108,10 +106,10 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; private Boolean forceSignerRoles = false; @@ -129,7 +127,7 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; private Boolean previewOnly = false; @@ -144,7 +142,7 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -193,12 +191,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId(String clientId) return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -219,12 +216,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress(Str return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the user that should be designated as the requester of this draft.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -253,12 +249,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -279,12 +274,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline(Boolean allo return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,12 +299,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign(Boolean all return this; } - /** + /** * 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. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -339,12 +332,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +365,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCu return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -399,12 +390,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions(SubEditorOp return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -425,12 +415,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions(SubFieldOpti return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -459,12 +448,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesIt return this; } - /** + /** * 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. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -493,12 +481,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fi return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -519,12 +506,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles(Boolean return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -545,12 +531,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage(Boole return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -571,12 +556,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest(Boolean holdR return this; } - /** + /** * 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`. * @return holdRequest - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -597,12 +581,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning(Bool return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. * @return isForEmbeddedSigning - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -623,12 +606,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -657,12 +639,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem(String ke return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -683,12 +664,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly(Boolean previ return this; } - /** + /** * 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). * @return previewOnly - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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).") @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -709,12 +689,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl(Str return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -735,12 +714,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview(Boolean showP return this; } - /** + /** * 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. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -761,12 +739,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper(Boole return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -795,12 +772,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem(SubUnclaim return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -821,12 +797,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions(SubSigning return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -847,12 +822,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl(String return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -873,12 +847,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow(Boolean skipMeN return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -899,12 +872,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -925,12 +897,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode(Boolean testMode return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -951,12 +922,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -977,12 +947,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields(Bo return this; } - /** + /** * 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. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1003,12 +972,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs(Boolean allowCcs return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * @return allowCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java index 6b0327d..9df838f 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java @@ -35,19 +35,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * */ -@ApiModel(description = "") @JsonPropertyOrder({ UnclaimedDraftCreateRequest.JSON_PROPERTY_TYPE, UnclaimedDraftCreateRequest.JSON_PROPERTY_FILES, @@ -74,8 +71,8 @@ UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_TEXT_TAGS, UnclaimedDraftCreateRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateRequest { /** * 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. @@ -116,37 +113,37 @@ public static TypeEnum fromValue(String value) { private TypeEnum type; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; @@ -155,13 +152,13 @@ public static TypeEnum fromValue(String value) { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -207,12 +204,11 @@ public UnclaimedDraftCreateRequest type(TypeEnum type) { return this; } - /** + /** * 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. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "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.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -241,12 +237,11 @@ public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +270,11 @@ public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * 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. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -301,12 +295,11 @@ public UnclaimedDraftCreateRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -335,12 +328,11 @@ public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsI return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,12 +361,11 @@ public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddress return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -395,12 +386,11 @@ public UnclaimedDraftCreateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -429,12 +419,11 @@ public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFiel return this; } - /** + /** * 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. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -455,12 +444,11 @@ public UnclaimedDraftCreateRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -489,12 +477,11 @@ public UnclaimedDraftCreateRequest addFormFieldGroupsItem(SubFormFieldGroup form return this; } - /** + /** * 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`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -523,12 +510,11 @@ public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFi return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -557,12 +543,11 @@ public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPer return this; } - /** + /** * 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` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -583,12 +568,11 @@ public UnclaimedDraftCreateRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * 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. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -609,12 +593,11 @@ public UnclaimedDraftCreateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -643,12 +626,11 @@ public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataIt return this; } - /** + /** * 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. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -669,12 +651,11 @@ public UnclaimedDraftCreateRequest showProgressStepper(Boolean showProgressStepp return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -703,12 +684,11 @@ public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signer return this; } - /** + /** * Add Signers to your Unclaimed Draft Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Unclaimed Draft Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -729,12 +709,11 @@ public UnclaimedDraftCreateRequest signingOptions(SubSigningOptions signingOptio return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -755,12 +734,11 @@ public UnclaimedDraftCreateRequest signingRedirectUrl(String signingRedirectUrl) return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -781,12 +759,11 @@ public UnclaimedDraftCreateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -807,12 +784,11 @@ public UnclaimedDraftCreateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -833,12 +809,11 @@ public UnclaimedDraftCreateRequest usePreexistingFields(Boolean usePreexistingFi return this; } - /** + /** * 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. * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -859,12 +834,11 @@ public UnclaimedDraftCreateRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * 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. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -885,12 +859,11 @@ public UnclaimedDraftCreateRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * 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. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java index 38c62b9..b0477d0 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ UnclaimedDraftCreateResponse.JSON_PROPERTY_UNCLAIMED_DRAFT, UnclaimedDraftCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateResponse { public static final String JSON_PROPERTY_UNCLAIMED_DRAFT = "unclaimed_draft"; private UnclaimedDraftResponse unclaimedDraft; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public UnclaimedDraftCreateResponse() { } @@ -74,14 +72,13 @@ public UnclaimedDraftCreateResponse unclaimedDraft(UnclaimedDraftResponse unclai return this; } - /** + /** * Get unclaimedDraft * @return unclaimedDraft - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public UnclaimedDraftResponse getUnclaimedDraft() { return unclaimedDraft; @@ -89,7 +86,7 @@ public UnclaimedDraftResponse getUnclaimedDraft() { @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setUnclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { this.unclaimedDraft = unclaimedDraft; } @@ -108,12 +105,11 @@ public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java index e85d406..5e4c639 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -45,8 +43,8 @@ UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftEditAndResendRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -95,12 +93,11 @@ public UnclaimedDraftEditAndResendRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -121,12 +118,11 @@ public UnclaimedDraftEditAndResendRequest editorOptions(SubEditorOptions editorO return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +143,11 @@ public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning(Boolean isForEmbe return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. * @return isForEmbeddedSigning - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +168,11 @@ public UnclaimedDraftEditAndResendRequest requesterEmailAddress(String requester return this; } - /** + /** * 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. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +193,11 @@ public UnclaimedDraftEditAndResendRequest requestingRedirectUrl(String requestin return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +218,11 @@ public UnclaimedDraftEditAndResendRequest showProgressStepper(Boolean showProgre return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +243,11 @@ public UnclaimedDraftEditAndResendRequest signingRedirectUrl(String signingRedir return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -277,12 +268,11 @@ public UnclaimedDraftEditAndResendRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java index cc849e0..a7212a2 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * A group of documents that a user can take ownership of via the claim URL. */ -@ApiModel(description = "A group of documents that a user can take ownership of via the claim URL.") @JsonPropertyOrder({ UnclaimedDraftResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, UnclaimedDraftResponse.JSON_PROPERTY_CLAIM_URL, @@ -43,8 +40,8 @@ UnclaimedDraftResponse.JSON_PROPERTY_EXPIRES_AT, UnclaimedDraftResponse.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; private String signatureRequestId; @@ -87,12 +84,11 @@ public UnclaimedDraftResponse signatureRequestId(String signatureRequestId) { return this; } - /** + /** * The ID of the signature request that is represented by this UnclaimedDraft. * @return signatureRequestId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the signature request that is represented by this UnclaimedDraft.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +109,11 @@ public UnclaimedDraftResponse claimUrl(String claimUrl) { return this; } - /** + /** * The URL to be used to claim this UnclaimedDraft. * @return claimUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL to be used to claim this UnclaimedDraft.") @JsonProperty(JSON_PROPERTY_CLAIM_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +134,11 @@ public UnclaimedDraftResponse signingRedirectUrl(String signingRedirectUrl) { return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +159,11 @@ public UnclaimedDraftResponse requestingRedirectUrl(String requestingRedirectUrl return this; } - /** + /** * 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.). * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "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.).") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +184,11 @@ public UnclaimedDraftResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * When the link expires. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +209,11 @@ public UnclaimedDraftResponse testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test draft. Signature requests made from test drafts have no legal value. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test draft. Signature requests made from test drafts have no legal value.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/dropbox/sign/model/WarningResponse.java b/src/main/java/com/dropbox/sign/model/WarningResponse.java index 225e4c9..8be1d98 100644 --- a/src/main/java/com/dropbox/sign/model/WarningResponse.java +++ b/src/main/java/com/dropbox/sign/model/WarningResponse.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** * A list of warnings. */ -@ApiModel(description = "A list of warnings.") @JsonPropertyOrder({ WarningResponse.JSON_PROPERTY_WARNING_MSG, WarningResponse.JSON_PROPERTY_WARNING_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class WarningResponse { public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; private String warningMsg; @@ -71,12 +68,11 @@ public WarningResponse warningMsg(String warningMsg) { return this; } - /** + /** * Warning message * @return warningMsg - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warning message") @JsonProperty(JSON_PROPERTY_WARNING_MSG) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -97,12 +93,11 @@ public WarningResponse warningName(String warningName) { return this; } - /** + /** * Warning name * @return warningName - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warning name") @JsonProperty(JSON_PROPERTY_WARNING_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java b/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java index 903eb2c..8bd0c74 100644 --- a/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java +++ b/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.dropbox.sign.model.EventCallbackRequest; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -35,9 +37,9 @@ public void testIsValid() throws Exception { EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); - Assert.assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); - Assert.assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); - Assert.assertEquals( + assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); + assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); + assertEquals( EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK, EventCallbackHelper.getCallbackType(callbackEvent) ); @@ -55,9 +57,9 @@ public void testIsValid() throws Exception { EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); - Assert.assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); - Assert.assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); - Assert.assertEquals( + assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); + assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); + assertEquals( EventCallbackHelper.EVENT_TYPE_APP_CALLBACK, EventCallbackHelper.getCallbackType(callbackEvent) ); diff --git a/src/test/java/com/dropbox/sign/FixtureTest.java b/src/test/java/com/dropbox/sign/FixtureTest.java index 2bef238..d173e8d 100644 --- a/src/test/java/com/dropbox/sign/FixtureTest.java +++ b/src/test/java/com/dropbox/sign/FixtureTest.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -58,7 +58,7 @@ public void testFixture() throws Exception { JsonNode actual = mapper.readTree(serialized); // String comparison doesn't work due to json fields may be out of order - Assert.assertEquals(expected, actual); + assertEquals(expected, actual); } } } diff --git a/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java b/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java index 4dcbdde..0ec09f9 100644 --- a/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java +++ b/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java @@ -4,8 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -30,13 +31,13 @@ public void testSubFormFieldsPerDocumentBase() throws Exception { SubFormFieldsPerDocumentBase base = SubFormFieldsPerDocumentBase.init(expected.toString()); - Assert.assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); + assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); String serialized = mapper.writeValueAsString(base); JsonNode actual = mapper.readTree(serialized); // String comparison doesn't work due to json fields may be out of order - Assert.assertEquals(expected, actual); + assertEquals(expected, actual); } } @@ -57,7 +58,7 @@ public void testSignersAllowsInt() throws Exception { SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); - Assert.assertEquals(expected_signer, result.getSigner()); + assertEquals(expected_signer, result.getSigner()); } } @@ -78,7 +79,7 @@ public void testSignersAllowsString() throws Exception { SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); - Assert.assertEquals(expected_signer, result.getSigner()); + assertEquals(expected_signer, result.getSigner()); } } } diff --git a/src/test/java/com/dropbox/sign/api/AccountApiTest.java b/src/test/java/com/dropbox/sign/api/AccountApiTest.java index 334e8d2..04e0e64 100644 --- a/src/test/java/com/dropbox/sign/api/AccountApiTest.java +++ b/src/test/java/com/dropbox/sign/api/AccountApiTest.java @@ -5,8 +5,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.stream.IntStream; @@ -24,7 +25,7 @@ public void accountCreateTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountCreateResponse response = accountApi.accountCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -36,7 +37,7 @@ public void accountGetTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountGetResponse response = accountApi.accountGet(null, "jack@example.com"); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -52,7 +53,7 @@ public void accountUpdateTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountGetResponse response = accountApi.accountUpdate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -68,7 +69,7 @@ public void accountVerifyTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountVerifyResponse response = accountApi.accountVerify(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -85,10 +86,10 @@ public void testHttpCodeRange() throws Exception { ApiClient apiClient = TestHelper.setUpMock(value, expectedResponse); AccountApi accountApi = new AccountApi(apiClient); accountApi.accountVerify(request); - Assert.fail(); + fail(); } catch (ApiException e) { - Assert.assertEquals(value, e.getCode()); - Assert.assertEquals(expectedResponse, e.getErrorResponse()); + assertEquals(value, e.getCode()); + assertEquals(expectedResponse, e.getErrorResponse()); } }); } diff --git a/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java b/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java index ddaee98..3c0d800 100644 --- a/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java +++ b/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -24,7 +25,7 @@ public void apiAppCreateTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -45,7 +46,7 @@ public void apiAppGetTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppGet(clientId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -57,7 +58,7 @@ public void apiAppListTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppListResponse response = api.apiAppList(1, 20); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -76,6 +77,6 @@ public void apiAppUpdateTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppUpdate(clientId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java b/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java index 08534d1..e70b325 100644 --- a/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java +++ b/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class BulkSendJobApiTest { @Test @@ -18,7 +19,7 @@ public void bulkSendJobGetTest() throws Exception { BulkSendJobApi api = new BulkSendJobApi(apiClient); BulkSendJobGetResponse response = api.bulkSendJobGet(id); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -30,6 +31,6 @@ public void bulkSendJobListTest() throws Exception { BulkSendJobApi api = new BulkSendJobApi(apiClient); BulkSendJobListResponse response = api.bulkSendJobList(1, 20); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java b/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java index 6bb3ed8..e52f455 100644 --- a/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java +++ b/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class EmbeddedApiTest { @Test @@ -23,7 +24,7 @@ public void embeddedEditUrlTest() throws Exception { EmbeddedApi api = new EmbeddedApi(apiClient); EmbeddedEditUrlResponse response = api.embeddedEditUrl(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -37,6 +38,6 @@ public void embeddedSignUrlTest() throws Exception { EmbeddedApi api = new EmbeddedApi(apiClient); EmbeddedSignUrlResponse response = api.embeddedSignUrl(signatureId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/OAuthApiTest.java b/src/test/java/com/dropbox/sign/api/OAuthApiTest.java index 2eb9518..fe95c51 100644 --- a/src/test/java/com/dropbox/sign/api/OAuthApiTest.java +++ b/src/test/java/com/dropbox/sign/api/OAuthApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OAuthApiTest { @Test @@ -21,7 +22,7 @@ public void oauthTokenGenerateTest() throws Exception { OAuthApi api = new OAuthApi(apiClient); OAuthTokenResponse response = api.oauthTokenGenerate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -37,6 +38,6 @@ public void oauthTokenRefreshTest() throws Exception { OAuthApi api = new OAuthApi(apiClient); OAuthTokenResponse response = api.oauthTokenRefresh(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/ReportApiTest.java b/src/test/java/com/dropbox/sign/api/ReportApiTest.java index 0dde796..65c4a9c 100644 --- a/src/test/java/com/dropbox/sign/api/ReportApiTest.java +++ b/src/test/java/com/dropbox/sign/api/ReportApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ReportApiTest { @Test @@ -21,6 +22,6 @@ public void reportCreateTest() throws Exception { ReportApi api = new ReportApi(apiClient); ReportCreateResponse response = api.reportCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java b/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java index ed48f9c..eadcbb2 100644 --- a/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java +++ b/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.mockito.Mockito; import static org.mockito.ArgumentMatchers.any; @@ -50,7 +51,7 @@ public void initAcceptsHashMap() throws Exception { ); assert data.getFormFieldsPerDocument() != null; - Assert.assertEquals( + assertEquals( "signature", data.getFormFieldsPerDocument().get(0).getType() ); @@ -70,7 +71,7 @@ public void signatureRequestBulkCreateEmbeddedWithTemplateTest() throws Exceptio SignatureRequestApi api = new SignatureRequestApi(apiClient); BulkSendJobSendResponse response = api.signatureRequestBulkCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -87,7 +88,7 @@ public void signatureRequestBulkSendWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); BulkSendJobSendResponse response = api.signatureRequestBulkSendWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -111,7 +112,7 @@ public void signatureRequestCreateEmbeddedTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestCreateEmbedded(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -128,7 +129,7 @@ public void signatureRequestCreateEmbeddedWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -147,7 +148,7 @@ public void signatureRequestGetTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestGet(signatureRequestId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -166,7 +167,7 @@ public void signatureRequestListTest() throws Exception { null ); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -180,7 +181,7 @@ public void signatureRequestReleaseHoldTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestReleaseHold(signatureRequestId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -198,7 +199,7 @@ public void signatureRequestRemindTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestRemind(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -222,7 +223,7 @@ public void signatureRequestSendTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSend(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -299,7 +300,7 @@ public void signatureRequestSendWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSendWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -317,6 +318,6 @@ public void signatureRequestUpdateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestUpdate(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/TeamApiTest.java b/src/test/java/com/dropbox/sign/api/TeamApiTest.java index a97b2b7..bc9e77e 100644 --- a/src/test/java/com/dropbox/sign/api/TeamApiTest.java +++ b/src/test/java/com/dropbox/sign/api/TeamApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * API tests for TeamApi @@ -24,7 +25,7 @@ public void teamAddMemberTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamAddMember(request, null); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -40,7 +41,7 @@ public void teamCreateTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -58,7 +59,7 @@ public void teamGetTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamGet(); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -74,7 +75,7 @@ public void teamRemoveMemberTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamRemoveMember(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -90,6 +91,6 @@ public void teamUpdateTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamUpdate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/TemplateApiTest.java b/src/test/java/com/dropbox/sign/api/TemplateApiTest.java index d69a966..5c1d04b 100644 --- a/src/test/java/com/dropbox/sign/api/TemplateApiTest.java +++ b/src/test/java/com/dropbox/sign/api/TemplateApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -25,7 +26,7 @@ public void templateAddUserTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateAddUser(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -42,7 +43,7 @@ public void templateCreateEmbeddedDraftTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateCreateEmbeddedDraftResponse response = api.templateCreateEmbeddedDraft(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -68,7 +69,7 @@ public void templateGetTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateGet(templateId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -82,7 +83,7 @@ public void templateListTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateListResponse response = api.templateList(accountId, 1, 20, null); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -100,7 +101,7 @@ public void templateRemoveUserTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateRemoveUser(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -119,6 +120,6 @@ public void templateUpdateFilesTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateUpdateFilesResponse response = api.templateUpdateFiles(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java b/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java index 6ee2b65..5d92e30 100644 --- a/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java +++ b/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -24,7 +25,7 @@ public void unclaimedDraftCreateTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -41,7 +42,7 @@ public void unclaimedDraftCreateEmbeddedTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbedded(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -58,7 +59,7 @@ public void unclaimedDraftCreateEmbeddedWithTemplateTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -76,6 +77,6 @@ public void unclaimedDraftEditAndResendTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftEditAndResend(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/templates/ApiClient.mustache b/templates/ApiClient.mustache index 5191e62..9cf548d 100644 --- a/templates/ApiClient.mustache +++ b/templates/ApiClient.mustache @@ -1,25 +1,19 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} +{{#useJakartaEe}} +import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; +{{/useJakartaEe}} +{{^useJakartaEe}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +{{/useJakartaEe}} import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; @@ -32,9 +26,9 @@ import com.sun.jersey.api.client.WebResource.Builder; import com.sun.jersey.multipart.FormDataMultiPart; import com.sun.jersey.multipart.file.FileDataBodyPart; -import javax.ws.rs.core.Cookie; -import javax.ws.rs.core.Response.Status.Family; -import javax.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Cookie; +import {{javaxPackage}}.ws.rs.core.Response.Status.Family; +import {{javaxPackage}}.ws.rs.core.MediaType; import java.util.Collection; import java.util.Collections; @@ -125,16 +119,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -144,8 +129,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -212,6 +197,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; return this; } @@ -552,7 +538,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null) { + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { return params; } diff --git a/templates/BeanValidationException.mustache b/templates/BeanValidationException.mustache index 3fc5b84..d8b0fa6 100644 --- a/templates/BeanValidationException.mustache +++ b/templates/BeanValidationException.mustache @@ -1,9 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/templates/Configuration.mustache b/templates/Configuration.mustache index cb425df..8e9720e 100644 --- a/templates/Configuration.mustache +++ b/templates/Configuration.mustache @@ -4,6 +4,8 @@ package {{invokerPackage}}; {{>generatedAnnotation}} public class Configuration { + public static final String VERSION = "{{{artifactVersion}}}"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/templates/CustomInstantDeserializer.mustache b/templates/CustomInstantDeserializer.mustache index 5ebea81..d4a3ca9 100644 --- a/templates/CustomInstantDeserializer.mustache +++ b/templates/CustomInstantDeserializer.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.core.JsonParser; diff --git a/templates/JSON.mustache b/templates/JSON.mustache index 00c5530..1d0a813 100644 --- a/templates/JSON.mustache +++ b/templates/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -36,11 +31,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/templates/JavaTimeFormatter.mustache b/templates/JavaTimeFormatter.mustache index 07d0eb6..f3fb34e 100644 --- a/templates/JavaTimeFormatter.mustache +++ b/templates/JavaTimeFormatter.mustache @@ -1,16 +1,9 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{^threetenbp}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; -{{/threetenbp}} /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/templates/README.mustache b/templates/README.mustache index edbb58c..72daeb2 100644 --- a/templates/README.mustache +++ b/templates/README.mustache @@ -1,13 +1,60 @@ # {{artifactId}} +{{^useCustomTemplateCode}} +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{/useCustomTemplateCode}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} +{{^useCustomTemplateCode}} +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +{{#jersey2}} +2. Maven (3.8.3+)/Gradle (7.2+) +{{/jersey2}} +{{^jersey2}} +2. Maven/Gradle +{{/jersey2}} + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -52,6 +99,7 @@ Run the following and everything is done for you: *Attention*: Any changes you have made to the SDK code that you have not made to the OAS file and/or the mustache template files _will be lost_ when you run this command. +{{/useCustomTemplateCode}} ### Maven users @@ -94,6 +142,7 @@ Then manually install the following JARs: - `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` - `target/lib/*.jar` +{{#useCustomTemplateCode}} ## Getting Started Please follow the [installation](#installation) instruction and execute the following Java code: @@ -104,62 +153,111 @@ REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE ``` {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} {{#jersey2}} - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import {{{invokerPackage}}}.*; - import {{{package}}}.{{{classname}}}; - - ... - - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - ``` +{{^useCustomTemplateCode}} +## Usage +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +## Using a Proxy +{{/useCustomTemplateCode}} + +To add a HTTP proxy for the API client, use `ClientConfig`: +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import {{{invokerPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +... + +ApiClient defaultClient = Configuration.getDefaultApiClient(); +ClientConfig clientConfig = defaultClient.getClientConfig(); +clientConfig.connectorProvider(new ApacheConnectorProvider()); +clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); +clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); +clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); +defaultClient.setClientConfig(clientConfig); + +{{{classname}}} apiInstance = new {{{classname}}}(defaultClient); +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` {{/jersey2}} -{{#jersey3}} - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import {{{invokerPackage}}}.*; - import {{{package}}}.{{{classname}}}; - - ... - - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); +{{^useCustomTemplateCode}} +## Getting Started - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - ``` +Please follow the [installation](#installation) instruction and execute the following Java code: -{{/jersey3}} +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} ## Documentation for API Endpoints @@ -175,11 +273,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} +
## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -187,10 +288,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth @@ -212,6 +321,7 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} +{{#useCustomTemplateCode}} ## About this package This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -249,3 +359,4 @@ mvn clean deploy ``` Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. +{{/useCustomTemplateCode}} diff --git a/templates/RFC3339DateFormat.mustache b/templates/RFC3339DateFormat.mustache index 46c7bb4..d35040f 100644 --- a/templates/RFC3339DateFormat.mustache +++ b/templates/RFC3339DateFormat.mustache @@ -7,9 +7,11 @@ import java.text.DateFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; +{{>generatedAnnotation}} public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); @@ -20,6 +22,7 @@ public class RFC3339DateFormat extends DateFormat { public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); } @Override @@ -41,4 +44,4 @@ public class RFC3339DateFormat extends DateFormat { public Object clone() { return super.clone(); } -} \ No newline at end of file +} diff --git a/templates/ServerConfiguration.mustache b/templates/ServerConfiguration.mustache index e21b633..7284004 100644 --- a/templates/ServerConfiguration.mustache +++ b/templates/ServerConfiguration.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Map; @@ -5,6 +7,7 @@ import java.util.Map; /** * Representing a Server configuration. */ +{{>generatedAnnotation}} public class ServerConfiguration { public String URL; public String description; @@ -39,10 +42,10 @@ public class ServerConfiguration { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/templates/ServerVariable.mustache b/templates/ServerVariable.mustache index 1978b1e..41246a7 100644 --- a/templates/ServerVariable.mustache +++ b/templates/ServerVariable.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.HashSet; @@ -5,6 +7,7 @@ import java.util.HashSet; /** * Representing a Server Variable for server URL template substitution. */ +{{>generatedAnnotation}} public class ServerVariable { public String description; public String defaultValue; diff --git a/templates/additionalOneOfTypeAnnotations.mustache b/templates/additionalOneOfTypeAnnotations.mustache new file mode 100644 index 0000000..283f8f9 --- /dev/null +++ b/templates/additionalOneOfTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalOneOfTypeAnnotations}}{{{.}}} +{{/additionalOneOfTypeAnnotations}} \ No newline at end of file diff --git a/templates/api.mustache b/templates/api.mustache index 28b18e2..8ce0ae1 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -13,12 +13,10 @@ import {{invokerPackage}}.Pair; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} @@ -46,7 +44,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} * @return {{.}} @@ -76,11 +74,11 @@ public class {{classname}} { .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); diff --git a/templates/apiException.mustache b/templates/apiException.mustache index 5b450c9..8944867 100644 --- a/templates/apiException.mustache +++ b/templates/apiException.mustache @@ -7,6 +7,8 @@ import java.util.List; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; @@ -37,7 +39,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us } public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } public ApiException(int code, String message) { @@ -77,4 +79,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", responseHeaders=" + responseHeaders + + ", responseBody='" + responseBody + '\'' + + '}'; + } } diff --git a/templates/api_doc.mustache b/templates/api_doc.mustache index 78783f1..5ab8c9d 100644 --- a/templates/api_doc.mustache +++ b/templates/api_doc.mustache @@ -4,10 +4,18 @@ All URIs are relative to *{{basePath}}* +{{^useCustomTemplateCode}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Method | HTTP request | Description ------------- | ------------- | ------------- {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} @@ -75,11 +83,20 @@ public class Example { ### Parameters +{{^useCustomTemplateCode}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} {{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/templates/api_test.mustache b/templates/api_test.mustache index b3a544d..155f46e 100644 --- a/templates/api_test.mustache +++ b/templates/api_test.mustache @@ -5,21 +5,21 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -38,7 +38,7 @@ public class {{classname}}Test { * if the Api call fails */ @Test - public void {{operationId}}Test() throws ApiException { + void {{operationId}}Test() throws ApiException { //{{#allParams}} //{{{dataType}}} {{paramName}} = null; //{{/allParams}} diff --git a/templates/auth/HttpBasicAuth.mustache b/templates/auth/HttpBasicAuth.mustache index 4d362cb..b5c72de 100644 --- a/templates/auth/HttpBasicAuth.mustache +++ b/templates/auth/HttpBasicAuth.mustache @@ -4,21 +4,12 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -46,15 +37,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/templates/auth/HttpBearerAuth.mustache b/templates/auth/HttpBearerAuth.mustache index 322281f..6ed2110 100644 --- a/templates/auth/HttpBearerAuth.mustache +++ b/templates/auth/HttpBearerAuth.mustache @@ -4,13 +4,15 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -22,7 +24,7 @@ public class HttpBearerAuth implements Authentication { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -31,12 +33,22 @@ public class HttpBearerAuth implements Authentication { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { return; } diff --git a/templates/auth/OAuthFlow.mustache b/templates/auth/OAuthFlow.mustache index 05bbf28..7a42526 100644 --- a/templates/auth/OAuthFlow.mustache +++ b/templates/auth/OAuthFlow.mustache @@ -2,10 +2,13 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ {{>generatedAnnotation}} public enum OAuthFlow { - accessCode, //called authorizationCode in OpenAPI 3.0 - implicit, - password, - application //called clientCredentials in OpenAPI 3.0 + ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 + IMPLICIT, + PASSWORD, + APPLICATION //called clientCredentials in OpenAPI 3.0 } diff --git a/templates/beanValidation.mustache b/templates/beanValidation.mustache index 1bc9afa..47f7109 100644 --- a/templates/beanValidation.mustache +++ b/templates/beanValidation.mustache @@ -1,5 +1,7 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{#isContainer}} {{^isPrimitiveType}} diff --git a/templates/beanValidationQueryParams.mustache b/templates/beanValidationQueryParams.mustache index c4ff01d..0f99bff 100644 --- a/templates/beanValidationQueryParams.mustache +++ b/templates/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull {{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/templates/build.gradle.mustache b/templates/build.gradle.mustache index d9718c1..06f9bd5 100644 --- a/templates/build.gradle.mustache +++ b/templates/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -126,18 +114,18 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "1.19.4" jodatime_version = "2.9.9" - junit_version = "4.13.1" + junit_version = "5.10.2" } dependencies { @@ -155,15 +143,26 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + } diff --git a/templates/generatedAnnotation.mustache b/templates/generatedAnnotation.mustache index 875d7b9..e05689d 100644 --- a/templates/generatedAnnotation.mustache +++ b/templates/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/templates/gitignore.mustache b/templates/gitignore.mustache index b6717f0..05e10a1 100644 --- a/templates/gitignore.mustache +++ b/templates/gitignore.mustache @@ -18,12 +18,12 @@ hs_err_pid* **/target target .gradle -build/ - -.composer -vendor - -# Intellij -.idea/ - -.openapi-generator +build + +{{#useCustomTemplateCode}} +/.composer +/vendor +/.idea/ +/.openapi-generator +/.github/workflows/maven.yml +{{/useCustomTemplateCode}} diff --git a/templates/gradle-wrapper.properties.mustache b/templates/gradle-wrapper.properties.mustache index 774fae8..552ae67 100644 --- a/templates/gradle-wrapper.properties.mustache +++ b/templates/gradle-wrapper.properties.mustache @@ -1,5 +1,12 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +{{^useCustomTemplateCode}} +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +{{/useCustomTemplateCode}} +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/templates/gradle.properties.mustache b/templates/gradle.properties.mustache index d445b39..101f52b 100644 --- a/templates/gradle.properties.mustache +++ b/templates/gradle.properties.mustache @@ -4,6 +4,7 @@ # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties # For example, uncomment below to build for Android #target = android +{{#useCustomTemplateCode}} GROUP={{groupId}} POM_ARTIFACT_ID={{artifactId}} VERSION_NAME={{artifactVersion}} @@ -30,6 +31,7 @@ RELEASE_SIGNING_ENABLED=true SONATYPE_CONNECT_TIMEOUT_SECONDS=300 SONATYPE_CLOSE_TIMEOUT_SECONDS=900 +{{/useCustomTemplateCode}} {{#gradleProperties}} {{{.}}} {{/gradleProperties}} diff --git a/templates/gradlew.bat.mustache b/templates/gradlew.bat.mustache index 6a68175..25da30d 100644 --- a/templates/gradlew.bat.mustache +++ b/templates/gradlew.bat.mustache @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/templates/gradlew.mustache b/templates/gradlew.mustache index 005bcde..9d0ce63 100644 --- a/templates/gradlew.mustache +++ b/templates/gradlew.mustache @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/templates/jackson_annotations.mustache b/templates/jackson_annotations.mustache index ccde126..4fbaf98 100644 --- a/templates/jackson_annotations.mustache +++ b/templates/jackson_annotations.mustache @@ -6,14 +6,9 @@ }} @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} \ No newline at end of file +{{#withXml}} + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isContainer}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) + {{/isContainer}} +{{/withXml}} \ No newline at end of file diff --git a/templates/javaBuilder.mustache b/templates/javaBuilder.mustache new file mode 100644 index 0000000..c027300 --- /dev/null +++ b/templates/javaBuilder.mustache @@ -0,0 +1,82 @@ +public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{ + + private {{classname}} instance; + + public Builder() { + this(new {{classname}}()); + } + + protected Builder({{classname}} instance) { + {{#parentModel}} + super(instance); + {{/parentModel}} + this.instance = instance; + } + + {{#vars}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.instance.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.instance.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#vendorExtensions.x-is-jackson-optional-nullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{/vars}} + +{{#parentVars}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { // inherited: {{isInherited}} + super.{{name}}({{name}}); + return this; + } + {{#vendorExtensions.x-is-jackson-optional-nullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/parentVars}} + + /** + * returns a built {{classname}} instance. + * + * The builder is not reusable. + */ + public {{classname}} build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused{{#parentModel}} + super.build();{{/parentModel}} + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static {{classname}}.Builder builder() { + return new {{classname}}.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public {{classname}}.Builder toBuilder() { + return new {{classname}}.Builder(){{#allVars}} + .{{name}}({{getter}}()){{/allVars}}; + } diff --git a/templates/libraries/apache-httpclient/ApiClient.mustache b/templates/libraries/apache-httpclient/ApiClient.mustache index 371f8ee..a00c6dc 100644 --- a/templates/libraries/apache-httpclient/ApiClient.mustache +++ b/templates/libraries/apache-httpclient/ApiClient.mustache @@ -1,52 +1,42 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; - -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.HttpStatus; -import org.apache.http.NameValuePair; -import org.apache.http.ParseException; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.RequestBuilder; -import org.apache.http.client.protocol.HttpClientContext; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.FileEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.impl.client.BasicCookieStore; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.cookie.BasicClientCookie; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; -import org.apache.http.cookie.Cookie; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} + +import org.apache.hc.client5.http.cookie.BasicCookieStore; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; +import org.apache.hc.client5.http.protocol.HttpClientContext; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; +import org.apache.hc.core5.http.NameValuePair; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.entity.ByteArrayEntity; +import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.io.entity.FileEntity; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; +import org.apache.hc.core5.http.message.BasicNameValuePair; import java.util.Collection; import java.util.Collections; @@ -58,7 +48,9 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.function.Supplier; import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -68,6 +60,9 @@ import java.io.File; import java.io.InputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.nio.file.Paths; @@ -131,8 +126,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private Map authentications; - private int statusCode; - private Map> responseHeaders; + private Map lastStatusCodeByThread = new ConcurrentHashMap<>(); + private Map>> lastResponseHeadersByThread = new ConcurrentHashMap<>(); private DateFormat dateFormat; @@ -150,16 +145,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} + {{#openApiNullable}} + objectMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -169,8 +158,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -200,6 +189,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the object mapper. + * + * @param objectMapper object mapper * @return API client */ public ApiClient setObjectMapper(ObjectMapper objectMapper) { @@ -212,6 +204,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the HTTP client. + * + * @param httpClient HTTP client * @return API client */ public ApiClient setHttpClient(CloseableHttpClient httpClient) { @@ -224,6 +219,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the base path. + * + * @param basePath base path * @return API client */ public ApiClient setBasePath(String basePath) { @@ -237,6 +235,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server. + * + * @param servers a list of server configuration * @return API client */ public ApiClient setServers(List servers) { @@ -249,6 +250,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server index. + * + * @param serverIndex server index * @return API client */ public ApiClient setServerIndex(Integer serverIndex) { @@ -261,6 +265,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server variables. + * + * @param serverVariables server variables * @return API client */ public ApiClient setServerVariables(Map serverVariables) { @@ -270,18 +277,21 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Gets the status code of the previous request + * * @return Status code */ + @Deprecated public int getStatusCode() { - return statusCode; + return lastStatusCodeByThread.get(Thread.currentThread().getId()); } /** * Gets the response headers of the previous request * @return Response headers */ + @Deprecated public Map> getResponseHeaders() { - return responseHeaders; + return lastResponseHeadersByThread.get(Thread.currentThread().getId()); } /** @@ -329,6 +339,20 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No Bearer authentication configured!"); } + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier the token supplier function + */ + public void setBearerToken(Supplier tokenSupplier) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } {{/hasHttpBearerMethods}} {{#hasHttpBasicMethods}} @@ -580,9 +604,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } - params.add(new Pair(name, parameterToString(value))); + params.add(new Pair(name, escapeString(parameterToString(value)))); return params; } @@ -600,7 +626,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null) { + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { return params; } @@ -707,7 +733,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Transform response headers into map + * Transforms response headers into map. + * + * @param headers HTTP headers + * @return a map of string array */ protected Map> transformResponseHeaders(Header[] headers) { Map> headersMap = new HashMap<>(); @@ -730,7 +759,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private ContentType getContentType(String headerValue) throws ApiException { try { return ContentType.parse(headerValue); - } catch (ParseException e) { + } catch (UnsupportedCharsetException e) { throw new ApiException("Could not parse content type " + headerValue); } } @@ -759,7 +788,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String mimeType = contentType.getMimeType(); if (isJsonMime(mimeType)) { try { - return new StringEntity(objectMapper.writeValueAsString(obj), contentType); + return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8)); } catch (JsonProcessingException e) { throw new ApiException(e); } @@ -772,7 +801,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else if (value instanceof byte[]) { multiPartBuilder.addBinaryBody(paramEntry.getKey(), (byte[]) value); } else { - multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + Charset charset = contentType.getCharset(); + if (charset != null) { + ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset); + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()), + customContentType); + } else { + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + } } } return multiPartBuilder.build(); @@ -781,11 +817,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { for (Entry paramEntry : formParams.entrySet()) { formValues.add(new BasicNameValuePair(paramEntry.getKey(), parameterToString(paramEntry.getValue()))); } - try { - return new UrlEncodedFormEntity(formValues); - } catch (UnsupportedEncodingException e) { - throw new ApiException(e); - } + return new UrlEncodedFormEntity(formValues, contentType.getCharset()); } else { // Handle files with unknown content type if (obj instanceof File) { @@ -798,9 +830,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Deserialize response content + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param valueType Return type + * @return Deserialized object + * @throws ApiException API exception + * @throws IOException IO exception */ - public T deserialize(HttpResponse response, TypeReference valueType) throws ApiException, IOException { + @SuppressWarnings("unchecked") + public T deserialize(CloseableHttpResponse response, TypeReference valueType) throws ApiException, IOException, ParseException { if (valueType == null) { return null; } @@ -814,18 +854,29 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String mimeType = getResponseMimeType(response); if (mimeType == null || isJsonMime(mimeType)) { // Assume json if no mime type - return objectMapper.readValue(entity.getContent(), valueType); + // convert input stream to string + String content = EntityUtils.toString(entity); + + if ("".equals(content)) { // returns null for empty body + return null; + } + + return objectMapper.readValue(content, valueType); + } else if (mimeType.toLowerCase().startsWith("text/")) { + // convert input stream to string + return (T) EntityUtils.toString(entity); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); throw new ApiException( "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", - response.getStatusLine().getStatusCode(), + response.getCode(), responseHeaders, EntityUtils.toString(entity) ); } } - private File downloadFileFromResponse(HttpResponse response) throws IOException { + private File downloadFileFromResponse(CloseableHttpResponse response) throws IOException { Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); File file = prepareDownloadFile(contentDisposition); @@ -868,14 +919,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Build full URL by concatenating base path, the given sub path and query parameters. + * Returns the URL of the client as defined by the server (if exists) or the base path. * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL + * @return The URL for the client. */ - private String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String getBaseURL() { String baseURL; if (serverIndex != null) { if (serverIndex < 0 || serverIndex >= servers.size()) { @@ -887,6 +935,20 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { baseURL = basePath; } + return baseURL; + } + + /** + * Build full URL by concatenating base URL, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject URL query string of the deep object parameters + * @return The full URL + */ + private String buildUrl(String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject) { + String baseURL = getBaseURL(); final StringBuilder url = new StringBuilder(); url.append(baseURL).append(path); @@ -903,7 +965,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { url.append("&"); } String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + // query parameter value already escaped as part of parameterToPair + url.append(escapeString(param.getName())).append("=").append(value); } } } @@ -925,6 +988,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } + if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) { + url.append(url.toString().contains("?") ? "&" : "?"); + url.append(urlQueryDeepObject); + } + return url.toString(); } @@ -943,13 +1011,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return cookie; } - protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException { - statusCode = response.getStatusLine().getStatusCode(); + protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { + int statusCode = response.getCode(); + lastStatusCodeByThread.put(Thread.currentThread().getId(), statusCode); if (statusCode == HttpStatus.SC_NO_CONTENT) { return null; } - responseHeaders = transformResponseHeaders(response.getAllHeaders()); + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + lastResponseHeadersByThread.put(Thread.currentThread().getId(), responseHeaders); + if (isSuccessfulStatus(statusCode)) { return this.deserialize(response, returnType); } else { @@ -966,6 +1037,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param method The request method, one of "GET", "POST", "PUT", and "DELETE" * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject A URL query string for deep object parameters * @param body The request body object - if it is not binary, otherwise null * @param headerParams The header parameters * @param cookieParams The cookie parameters @@ -982,6 +1054,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String method, List queryParams, List collectionQueryParams, + String urlQueryDeepObject, Object body, Map headerParams, Map cookieParams, @@ -995,16 +1068,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); - RequestBuilder builder = RequestBuilder.create(method); + ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); builder.setUri(url); - RequestConfig config = RequestConfig.custom() - .setConnectionRequestTimeout(connectionTimeout) - .build(); - builder.setConfig(config); - if (accept != null) { builder.addHeader("Accept", accept); } @@ -1038,11 +1106,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { throw new ApiException("method " + method + " does not support a request body"); } + } else { + // for empty body + builder.setEntity(new StringEntity("", contentTypeObj)); } try (CloseableHttpResponse response = httpClient.execute(builder.build(), context)) { return processResponse(response, returnType); - } catch (IOException e) { + } catch (IOException | ParseException e) { throw new ApiException(e); } } diff --git a/templates/libraries/apache-httpclient/BaseApi.mustache b/templates/libraries/apache-httpclient/BaseApi.mustache new file mode 100644 index 0000000..8b48de0 --- /dev/null +++ b/templates/libraries/apache-httpclient/BaseApi.mustache @@ -0,0 +1,110 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.util.Collections; +import java.util.Map; + +{{>generatedAnnotation}} +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(Configuration.getDefaultApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method) throws ApiException { + invokeAPI(url, method, null, null, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param additionalHeaders Additional headers for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Map additionalHeaders) throws ApiException { + invokeAPI(url, method, null, null, additionalHeaders); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Object request) throws ApiException { + invokeAPI(url, method, request, null, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param additionalHeaders Additional headers for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Object request, Map additionalHeaders) throws ApiException { + invokeAPI(url, method, request, null, additionalHeaders); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public T invokeAPI(String url, String method, TypeReference returnType) throws ApiException { + return invokeAPI(url, method, null, returnType, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public T invokeAPI(String url, String method, Object request, TypeReference returnType) throws ApiException { + return invokeAPI(url, method, request, returnType, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @param additionalHeaders Additional headers for the request. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public abstract T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException; +} diff --git a/templates/libraries/apache-httpclient/README.mustache b/templates/libraries/apache-httpclient/README.mustache index 9082f62..b50e7db 100644 --- a/templates/libraries/apache-httpclient/README.mustache +++ b/templates/libraries/apache-httpclient/README.mustache @@ -8,6 +8,8 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} + {{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} @@ -20,7 +22,7 @@ Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven/Gradle ## Installation @@ -158,11 +160,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -170,10 +175,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth diff --git a/templates/libraries/apache-httpclient/api.mustache b/templates/libraries/apache-httpclient/api.mustache index 44122a1..27b4564 100644 --- a/templates/libraries/apache-httpclient/api.mustache +++ b/templates/libraries/apache-httpclient/api.mustache @@ -5,49 +5,75 @@ import com.fasterxml.jackson.core.type.TypeReference; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.BaseApi; import {{invokerPackage}}.Configuration; +{{#models.0}} import {{modelPackage}}.*; +{{/models.0}} import {{invokerPackage}}.Pair; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +import java.util.StringJoiner; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{>generatedAnnotation}} {{#operations}} -public class {{classname}} { - private ApiClient apiClient; +public class {{classname}} extends BaseApi { public {{classname}}() { - this(Configuration.getDefaultApiClient()); + super(Configuration.getDefaultApiClient()); } public {{classname}}(ApiClient apiClient) { - this.apiClient = apiClient; + super(apiClient); } - public ApiClient getApiClient() { - return apiClient; + {{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + * @throws ApiException if fails to make API call + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}this.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}Collections.emptyMap()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - {{#operation}} /** * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} + * @param additionalHeaders additionalHeaders for this call {{#returnType}} * @return {{returnType}} {{/returnType}} @@ -63,7 +89,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map additionalHeaders) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -75,21 +101,58 @@ public class {{classname}} { String localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} + {{#isDeepObject}} + localVarQueryParameterBaseName = "{{{baseName}}}"; + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}")); + {{/isArray}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(apiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} + {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isExplode}} + {{/isDeepObject}} {{/queryParams}} - {{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/headerParams}} + localVarHeaderParams.putAll(additionalHeaders); + {{#cookieParams}}if ({{paramName}} != null) localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/cookieParams}} @@ -121,6 +184,7 @@ public class {{classname}} { "{{httpMethod}}", localVarQueryParams, localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams, @@ -131,6 +195,49 @@ public class {{classname}} { {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} ); } + + {{#-last}} + @Override + public T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException { + String localVarPath = url.replace(apiClient.getBaseURL(), ""); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + return apiClient.invokeAPI( + localVarPath, + method, + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + request, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + returnType + ); + } + {{/-last}} {{/operation}} } {{/operations}} diff --git a/templates/libraries/apache-httpclient/api_test.mustache b/templates/libraries/apache-httpclient/api_test.mustache index 8071e03..b4393ea 100644 --- a/templates/libraries/apache-httpclient/api_test.mustache +++ b/templates/libraries/apache-httpclient/api_test.mustache @@ -5,21 +5,26 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/templates/libraries/apache-httpclient/build.gradle.mustache b/templates/libraries/apache-httpclient/build.gradle.mustache index 5ae33f3..f18581f 100644 --- a/templates/libraries/apache-httpclient/build.gradle.mustache +++ b/templates/libraries/apache-httpclient/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -125,26 +113,22 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.6" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} - httpclient_version = "4.5.13" + httpclient_version = "5.1.3" jodatime_version = "2.9.9" - junit_version = "4.13.1" + junit_version = "4.13.2" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "org.apache.httpcomponents:httpclient:$httpclient_version" - implementation "org.apache.httpcomponents:httpmime:$httpclient_version" + implementation "org.apache.httpcomponents.client5:httpclient5:$httpclient_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -155,15 +139,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/templates/libraries/apache-httpclient/pom.mustache b/templates/libraries/apache-httpclient/pom.mustache index 89c3f5f..74a70a3 100644 --- a/templates/libraries/apache-httpclient/pom.mustache +++ b/templates/libraries/apache-httpclient/pom.mustache @@ -43,8 +43,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 + 1.8 + 1.8 true 128m 512m @@ -58,7 +60,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -78,17 +80,17 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest + 10 @@ -110,11 +112,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -126,7 +127,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.3.0 add_sources @@ -154,33 +155,13 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.4.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -194,7 +175,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.1 attach-sources @@ -215,7 +196,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -232,11 +213,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -248,13 +238,8 @@ - org.apache.httpcomponents - httpclient - ${httpclient-version} - - - org.apache.httpcomponents - httpmime + org.apache.httpcomponents.client5 + httpclient5 ${httpclient-version} @@ -272,78 +257,77 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + {{/joda}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + {{/useBeanValidation}} {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.1.Final - + + + org.hibernate + hibernate-validator + 5.4.3.Final + {{/performBeanValidation}} {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - + + + com.google.android + android + 4.1.1.4 + provided + {{/parcelableModel}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} jakarta.annotation jakarta.annotation-api @@ -352,25 +336,35 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.21 - 4.5.13 - 2.12.1 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 5.2.1 + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 1.0.0 - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.2 diff --git a/templates/libraries/feign/ApiClient.mustache b/templates/libraries/feign/ApiClient.mustache index 5c4e789..9a5b9bc 100644 --- a/templates/libraries/feign/ApiClient.mustache +++ b/templates/libraries/feign/ApiClient.mustache @@ -1,41 +1,47 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.LinkedHashMap; import java.util.Map; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} +{{#jackson}} import feign.okhttp.OkHttpClient; - import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} +{{/jackson}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} +{{#jackson}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} +{{/jackson}} import feign.Feign; import feign.RequestInterceptor; import feign.form.FormEncoder; +{{#jackson}} import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; +{{/jackson}} +{{#gson}} +import feign.gson.GsonDecoder; +import feign.gson.GsonEncoder; +{{/gson}} import feign.slf4j.Slf4jLogger; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; import {{invokerPackage}}.auth.ApiKeyAuth; +{{#jackson}} import {{invokerPackage}}.ApiResponseDecoder; +{{/jackson}} {{#hasOAuthMethods}} import {{invokerPackage}}.auth.ApiErrorDecoder; @@ -53,14 +59,17 @@ public class ApiClient { public interface Api {} + {{#jackson}} protected ObjectMapper objectMapper; + {{/jackson}} private String basePath = "{{{basePath}}}"; private Map apiAuthorizations; private Feign.Builder feignBuilder; public ApiClient() { - objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); + {{#jackson}} + objectMapper = createObjectMapper(); feignBuilder = Feign.builder() .client(new OkHttpClient()) .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) @@ -70,6 +79,17 @@ public class ApiClient { .retryer(new Retryer.Default(0, 0, 2)) {{/hasOAuthMethods}} .logger(new Slf4jLogger()); + {{/jackson}} + {{#gson}} + feignBuilder = Feign.builder() + .encoder(new FormEncoder(new GsonEncoder())) + .decoder(new GsonDecoder()) + {{#hasOAuthMethods}} + .errorDecoder(new ApiErrorDecoder()) + .retryer(new Retryer.Default(0, 0, 2)) + {{/hasOAuthMethods}} + .logger(new Slf4jLogger()); + {{/gson}} } public ApiClient(String[] authNames) { @@ -77,26 +97,26 @@ public class ApiClient { for(String authName : authNames) { log.log(Level.FINE, "Creating authentication {0}", authName); {{#hasAuthMethods}} - RequestInterceptor auth; + RequestInterceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}} {{#isBasicBasic}} auth = new HttpBasicAuth(); {{/isBasicBasic}} - {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} - {{/isBasic}} + {{/isBasicBearer}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = buildOauthRequestInterceptor(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = buildOauthRequestInterceptor(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth); + if (auth != null) { + addAuthorization(authName, auth); + } {{/hasAuthMethods}} {{^hasAuthMethods}} throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -148,6 +168,7 @@ public class ApiClient { return this; } + {{#jackson}} private ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); @@ -159,29 +180,21 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); {{/openApiNullable}} return objectMapper; } + {{/jackson}} {{#hasOAuthMethods}} private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { switch (flow) { - case password: + case PASSWORD: return new OauthPasswordGrant(tokenUrl, scopes); - case application: + case APPLICATION: return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); default: throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); @@ -189,6 +202,8 @@ public class ApiClient { } {{/hasOAuthMethods}} + + {{#jackson}} public ObjectMapper getObjectMapper(){ return objectMapper; } @@ -196,6 +211,7 @@ public class ApiClient { public void setObjectMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; } + {{/jackson}} /** * Creates a feign client for given API interface. @@ -252,6 +268,15 @@ public class ApiClient { apiAuthorization.setBearerToken(bearerToken); } + /** + * Helper method to configure the supplier of bearer tokens. + * @param tokenSupplier the supplier of bearer tokens. + */ + public void setBearerToken(Supplier tokenSupplier) { + HttpBearerAuth apiAuthorization = getAuthorization(HttpBearerAuth.class); + apiAuthorization.setBearerToken(tokenSupplier); + } + /** * Helper method to configure the first api key found * @param apiKey API key @@ -274,8 +299,8 @@ public class ApiClient { {{#hasOAuthMethods}} /** * Helper method to configure the client credentials for Oauth - * @param username Username - * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setClientCredentials(String clientId, String clientSecret) { OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); @@ -286,6 +311,8 @@ public class ApiClient { * Helper method to configure the username/password for Oauth password grant * @param username Username * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setOauthPassword(String username, String password, String clientId, String clientSecret) { OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); @@ -314,7 +341,7 @@ public class ApiClient { /** * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Acesss token listener + * @param accessTokenListener Access token listener */ public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { OAuth apiAuthorization = getAuthorization(OAuth.class); diff --git a/templates/libraries/feign/ApiResponseDecoder.mustache b/templates/libraries/feign/ApiResponseDecoder.mustache index ef171de..9062b64 100644 --- a/templates/libraries/feign/ApiResponseDecoder.mustache +++ b/templates/libraries/feign/ApiResponseDecoder.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.databind.ObjectMapper; @@ -22,17 +24,16 @@ public class ApiResponseDecoder extends JacksonDecoder { @Override public Object decode(Response response, Type type) throws IOException { - Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse - Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself - responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; + Type responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); - return new ApiResponse(response.status(), responseHeaders, body); + Map> responseHeaders = Collections.unmodifiableMap(response.headers()); + return new ApiResponse<>(response.status(), responseHeaders, body); } else { //The response is not encapsulated in the ApiResponse, decode the Dto as normal return super.decode(response, type); } } -} \ No newline at end of file +} diff --git a/templates/libraries/feign/EncodingUtils.mustache b/templates/libraries/feign/EncodingUtils.mustache index 705eb6a..2312fc6 100644 --- a/templates/libraries/feign/EncodingUtils.mustache +++ b/templates/libraries/feign/EncodingUtils.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.UnsupportedEncodingException; diff --git a/templates/libraries/feign/ParamExpander.mustache b/templates/libraries/feign/ParamExpander.mustache index 2f5095d..88f0ae2 100644 --- a/templates/libraries/feign/ParamExpander.mustache +++ b/templates/libraries/feign/ParamExpander.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import feign.Param; diff --git a/templates/libraries/feign/additional_properties.mustache b/templates/libraries/feign/additional_properties.mustache new file mode 100644 index 0000000..8e71827 --- /dev/null +++ b/templates/libraries/feign/additional_properties.mustache @@ -0,0 +1,45 @@ +{{#additionalPropertiesType}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public {{{.}}} getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/additionalPropertiesType}} diff --git a/templates/libraries/feign/api.mustache b/templates/libraries/feign/api.mustache index c494070..af05d65 100644 --- a/templates/libraries/feign/api.mustache +++ b/templates/libraries/feign/api.mustache @@ -10,12 +10,15 @@ import {{modelPackage}}.ApiResponse; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import feign.*; {{>generatedAnnotation}} @@ -44,12 +47,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); /** * {{summary}} @@ -74,12 +77,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#hasQueryParams}} @@ -119,12 +122,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams); /** * {{summary}} @@ -159,12 +162,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ - {{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", - {{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} + {{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", + {{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams); /** diff --git a/templates/libraries/feign/api_test.mustache b/templates/libraries/feign/api_test.mustache index a7f5bb0..1db8411 100644 --- a/templates/libraries/feign/api_test.mustache +++ b/templates/libraries/feign/api_test.mustache @@ -6,13 +6,18 @@ import {{invokerPackage}}.ApiClient; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/templates/libraries/feign/auth/ApiErrorDecoder.mustache b/templates/libraries/feign/auth/ApiErrorDecoder.mustache index da87f25..aeea7f9 100644 --- a/templates/libraries/feign/auth/ApiErrorDecoder.mustache +++ b/templates/libraries/feign/auth/ApiErrorDecoder.mustache @@ -1,5 +1,9 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; +import java.util.Date; + import feign.Response; import feign.RetryableException; import feign.codec.ErrorDecoder; @@ -18,7 +22,7 @@ public class ApiErrorDecoder implements ErrorDecoder { Exception httpException = defaultErrorDecoder.decode(methodKey, response); if (response.status() == 401 || response.status() == 403) { return new RetryableException(response.status(), "Received status " + response.status() + " trying to renew access token", - response.request().httpMethod(), httpException, null, response.request()); + response.request().httpMethod(), httpException, (Date) null, response.request()); } return httpException; } diff --git a/templates/libraries/feign/auth/ApiKeyAuth.mustache b/templates/libraries/feign/auth/ApiKeyAuth.mustache index c03fe5c..bf7e32c 100644 --- a/templates/libraries/feign/auth/ApiKeyAuth.mustache +++ b/templates/libraries/feign/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; diff --git a/templates/libraries/feign/auth/DefaultApi20Impl.mustache b/templates/libraries/feign/auth/DefaultApi20Impl.mustache index 72b0a00..0c178ae 100644 --- a/templates/libraries/feign/auth/DefaultApi20Impl.mustache +++ b/templates/libraries/feign/auth/DefaultApi20Impl.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.api.DefaultApi20; diff --git a/templates/libraries/feign/auth/HttpBasicAuth.mustache b/templates/libraries/feign/auth/HttpBasicAuth.mustache index c308131..d95589b 100644 --- a/templates/libraries/feign/auth/HttpBasicAuth.mustache +++ b/templates/libraries/feign/auth/HttpBasicAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; diff --git a/templates/libraries/feign/auth/HttpBearerAuth.mustache b/templates/libraries/feign/auth/HttpBearerAuth.mustache index 2240a55..466c1b2 100644 --- a/templates/libraries/feign/auth/HttpBearerAuth.mustache +++ b/templates/libraries/feign/auth/HttpBearerAuth.mustache @@ -1,14 +1,18 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; import feign.RequestTemplate; +import java.util.Optional; +import java.util.function.Supplier; /** * An interceptor that adds the request header needed to use HTTP bearer authentication. */ public class HttpBearerAuth implements RequestInterceptor { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -16,21 +20,35 @@ public class HttpBearerAuth implements RequestInterceptor { /** * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void apply(RequestTemplate template) { - if(bearerToken == null) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { return; } diff --git a/templates/libraries/feign/auth/OAuth.mustache b/templates/libraries/feign/auth/OAuth.mustache index e608296..8309a1f 100644 --- a/templates/libraries/feign/auth/OAuth.mustache +++ b/templates/libraries/feign/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.model.OAuth2AccessToken; @@ -10,6 +12,9 @@ import java.util.Collection; {{>generatedAnnotation}} public abstract class OAuth implements RequestInterceptor { + //https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + static final int LEEWAY_SECONDS = 10; + static final int MILLIS_PER_SECOND = 1000; public interface AccessTokenListener { @@ -17,7 +22,7 @@ public abstract class OAuth implements RequestInterceptor { } private volatile String accessToken; - private Long expirationTimeMillis; + private Long expirationTimeSeconds; private AccessTokenListener accessTokenListener; protected OAuth20Service service; @@ -39,6 +44,7 @@ public abstract class OAuth implements RequestInterceptor { } String accessToken = getAccessToken(); if (accessToken != null) { + template.removeHeader("Authorization"); template.header("Authorization", "Bearer " + accessToken); } } @@ -73,7 +79,7 @@ public abstract class OAuth implements RequestInterceptor { public synchronized String getAccessToken() { // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + if (expirationTimeSeconds == null || System.currentTimeMillis() >= expirationTimeSeconds * MILLIS_PER_SECOND) { updateAccessToken(); } return accessToken; @@ -86,7 +92,7 @@ public abstract class OAuth implements RequestInterceptor { */ public synchronized void setAccessToken(String accessToken, Integer expiresIn) { this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS; } -} \ No newline at end of file +} diff --git a/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache b/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache index ef22c21..3b8c342 100644 --- a/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache +++ b/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.ServiceBuilder; @@ -21,7 +23,7 @@ public class OauthClientCredentialsGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.application; + return OAuthFlow.APPLICATION; } /** diff --git a/templates/libraries/feign/auth/OauthPasswordGrant.mustache b/templates/libraries/feign/auth/OauthPasswordGrant.mustache index 870c375..b51ee91 100644 --- a/templates/libraries/feign/auth/OauthPasswordGrant.mustache +++ b/templates/libraries/feign/auth/OauthPasswordGrant.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.ServiceBuilder; @@ -24,7 +26,7 @@ public class OauthPasswordGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.password; + return OAuthFlow.PASSWORD; } /** @@ -45,4 +47,4 @@ public class OauthPasswordGrant extends OAuth { .defaultScope(scopes) .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); } -} \ No newline at end of file +} diff --git a/templates/libraries/feign/build.gradle.mustache b/templates/libraries/feign/build.gradle.mustache index c9bf7c3..8af1cb1 100644 --- a/templates/libraries/feign/build.gradle.mustache +++ b/templates/libraries/feign/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -101,17 +101,16 @@ test { } ext { - swagger_annotations_version = "1.5.24" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + swagger_annotations_version = "1.6.11" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{/jackson}} {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} - feign_version = "10.11" + feign_version = "10.12" feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" @@ -121,25 +120,24 @@ dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.github.openfeign:feign-core:$feign_version" + {{#jackson}} implementation "io.github.openfeign:feign-jackson:$feign_version" + {{/jackson}} implementation "io.github.openfeign:feign-slf4j:$feign_version" implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" + {{#jackson}} + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + {{/joda}} implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#joda}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" - {{/joda}} - {{#java8}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" @@ -147,7 +145,7 @@ dependencies { testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" - testImplementation "com.github.tomakehurst:wiremock-jre8:2.27.2" + testImplementation "com.github.tomakehurst:wiremock-jre8:2.35.1" testImplementation "org.hamcrest:hamcrest:2.2" testImplementation "commons-io:commons-io:2.8.0" testImplementation "ch.qos.logback:logback-classic:1.2.3" diff --git a/templates/libraries/feign/build.sbt.mustache b/templates/libraries/feign/build.sbt.mustache index f2912f0..9af32c2 100644 --- a/templates/libraries/feign/build.sbt.mustache +++ b/templates/libraries/feign/build.sbt.mustache @@ -9,24 +9,28 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "io.swagger" % "swagger-annotations" % "1.6.11" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "io.github.openfeign" % "feign-core" % "10.11" % "compile", - "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", - "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", + "io.github.openfeign" % "feign-core" % "10.12" % "compile", +{{#jackson}} + "io.github.openfeign" % "feign-jackson" % "10.12" % "compile", +{{/jackson}} + "io.github.openfeign" % "feign-slf4j" % "10.12" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", - "io.github.openfeign" % "feign-okhttp" % "10.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.9.10" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + "io.github.openfeign" % "feign-okhttp" % "10.12" % "compile", +{{#jackson}} + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", +{{/jackson}} "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", - "com.github.tomakehurst" % "wiremock-jre8" % "2.27.2" % "test", + "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", "org.hamcrest" % "hamcrest" % "2.2" % "test", "commons-io" % "commons-io" % "2.8.0" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/templates/libraries/feign/model.mustache b/templates/libraries/feign/model.mustache new file mode 100644 index 0000000..5fa9bca --- /dev/null +++ b/templates/libraries/feign/model.mustache @@ -0,0 +1,78 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +{{#models}} +{{#model}} +{{#additionalPropertiesType}} +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +{{/additionalPropertiesType}} +{{/model}} +{{/models}} +import java.util.Objects; +import java.util.Arrays; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>pojo}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/templates/libraries/feign/model/ApiResponse.mustache b/templates/libraries/feign/model/ApiResponse.mustache index bc460dc..9c9b107 100644 --- a/templates/libraries/feign/model/ApiResponse.mustache +++ b/templates/libraries/feign/model/ApiResponse.mustache @@ -1,19 +1,21 @@ +{{>licenseInfo}} + package {{modelPackage}}; import java.util.Map; -import java.util.List; +import java.util.Collection; public class ApiResponse{ final private int statusCode; - final private Map> headers; + final private Map> headers; final private T data; /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response */ - public ApiResponse(int statusCode, Map> headers) { + public ApiResponse(int statusCode, Map> headers) { this(statusCode, headers, null); } @@ -22,7 +24,7 @@ public class ApiResponse{ * @param headers The headers of HTTP response * @param data The object deserialized from response bod */ - public ApiResponse(int statusCode, Map> headers, T data) { + public ApiResponse(int statusCode, Map> headers, T data) { this.statusCode = statusCode; this.headers = headers; this.data = data; @@ -32,7 +34,7 @@ public class ApiResponse{ return statusCode; } - public Map> getHeaders() { + public Map> getHeaders() { return headers; } diff --git a/templates/libraries/feign/model_test.mustache b/templates/libraries/feign/model_test.mustache index 0d75e12..2759ff5 100644 --- a/templates/libraries/feign/model_test.mustache +++ b/templates/libraries/feign/model_test.mustache @@ -6,13 +6,6 @@ package {{package}}; {{/imports}} import org.junit.jupiter.api.Test; -{{#fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - /** * Model tests for {{classname}} */ diff --git a/templates/libraries/okhttp-gson-nextgen/pojo.mustache b/templates/libraries/feign/pojo.mustache similarity index 54% rename from templates/libraries/okhttp-gson-nextgen/pojo.mustache rename to templates/libraries/feign/pojo.mustache index b30ce06..fe97e3b 100644 --- a/templates/libraries/okhttp-gson-nextgen/pojo.mustache +++ b/templates/libraries/feign/pojo.mustache @@ -1,37 +1,29 @@ -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import {{invokerPackage}}.JSON; - /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} @JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -55,29 +47,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); @@ -88,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{^isContainer}} {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; @@ -96,22 +81,35 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} - public {{classname}}() { {{#parent}}{{#parcelableModel}} - super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} - this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} - }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} - }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} {{#vars}} {{^isReadOnly}} @@ -122,10 +120,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -135,11 +133,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -147,10 +143,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -162,7 +158,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } {{/required}} this.{{name}}.put(key, {{name}}Item); @@ -172,7 +168,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -189,25 +185,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} {{#jsonb}} @JsonbProperty("{{baseName}}") {{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -256,7 +257,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isReadOnly}} {{/vars}} - +{{>libraries/feign/additional_properties}} @Override public boolean equals(Object o) { {{#useReflectionEqualsHashCode}} @@ -306,7 +307,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} sb.append("}"); return sb.toString(); @@ -322,7 +323,200 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -383,159 +577,4 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }; {{/parcelableModel}} - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - {{#allVars}} - openapiFields.add("{{baseName}}"); - {{/allVars}} - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - {{#requiredVars}} - openapiRequiredFields.add("{{baseName}}"); - {{/requiredVars}} - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if ({{classname}}.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); - } - } - {{^hasChildren}} - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!{{classname}}.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - {{#requiredVars}} - {{#-first}} - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : {{classname}}.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - {{/-first}} - {{/requiredVars}} - {{/hasChildren}} - {{^discriminator}} - {{#vars}} - {{#isArray}} - {{#items.isModel}} - JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); - {{#isRequired}} - // validate the required field `{{{baseName}}}` (array) - for (int i = 0; i < jsonArray{{name}}.size(); i++) { - {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; - {{/isRequired}} - {{^isRequired}} - // validate the optional field `{{{baseName}}}` (array) - if (jsonArray{{name}} != null) { - for (int i = 0; i < jsonArray{{name}}.size(); i++) { - {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; - } - {{/isRequired}} - {{/items.isModel}} - {{/isArray}} - {{^isContainer}} - {{#isModel}} - {{#isRequired}} - // validate the required field `{{{baseName}}}` - {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); - {{/isRequired}} - {{^isRequired}} - // validate the optional field `{{{baseName}}}` - if (jsonObj.getAsJsonObject("{{{baseName}}}") != null) { - {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); - } - {{/isRequired}} - {{/isModel}} - {{/isContainer}} - {{/vars}} - {{/discriminator}} - {{#hasChildren}} - {{#discriminator}} - - String discriminatorValue = jsonObj.get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{mappingName}}": - {{modelName}}.validateJsonObject(jsonObj); - break; - {{/mappedModels}} - default: - throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); - } - {{/discriminator}} - {{/hasChildren}} - } - -{{^hasChildren}} - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter<{{classname}}> thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } -{{/hasChildren}} - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } diff --git a/templates/libraries/feign/pom.mustache b/templates/libraries/feign/pom.mustache index f57614c..9be4a09 100644 --- a/templates/libraries/feign/pom.mustache +++ b/templates/libraries/feign/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M4 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none 1.8 @@ -213,11 +213,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -232,11 +241,20 @@ feign-core ${feign-version} + {{#jackson}} io.github.openfeign feign-jackson ${feign-version} + {{/jackson}} + {{#gson}} + + io.github.openfeign + feign-gson + ${feign-version} + + {{/gson}} io.github.openfeign feign-slf4j @@ -253,6 +271,7 @@ ${feign-version} + {{#jackson}} com.fasterxml.jackson.core @@ -269,6 +288,14 @@ jackson-databind ${jackson-databind-version} + {{/jackson}} + {{#gson}} + + com.google.code.gson + gson + ${gson-version} + + {{/gson}} {{#openApiNullable}} org.openapitools @@ -291,20 +318,13 @@ ${jackson-version} {{/joda}} - {{#java8}} + {{#jackson}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} + {{/jackson}} com.github.scribejava scribejava-core @@ -316,12 +336,21 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} ch.qos.logback logback-classic - 1.2.3 + 1.3.13 test @@ -345,13 +374,7 @@ com.github.tomakehurst wiremock-jre8 - 2.27.2 - test - - - commons-io - commons-io - 2.8.0 + 2.35.1 test @@ -360,20 +383,35 @@ 1.8 ${java.version} ${java.version} - 1.5.24 - 10.11 + {{#swagger1AnnotationLibrary}} + 1.6.11 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 13.2.1 3.8.0 - 2.10.3 + {{#jackson}} + 2.17.1 + 2.17.1 + {{/jackson}} + {{#gson}} + 2.10.1 + {{/gson}} {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} - 2.10.3 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - 5.7.0 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.0 1.0.0 - 8.0.0 + 8.3.3 diff --git a/templates/libraries/google-api-client/ApiClient.mustache b/templates/libraries/google-api-client/ApiClient.mustache index aa91362..03c44a8 100644 --- a/templates/libraries/google-api-client/ApiClient.mustache +++ b/templates/libraries/google-api-client/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{apiPackage}}.*; @@ -10,15 +12,7 @@ import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.google.api.client.googleapis.util.Utils; import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.HttpRequestFactory; @@ -46,16 +40,7 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); diff --git a/templates/libraries/google-api-client/api.mustache b/templates/libraries/google-api-client/api.mustache index 97b1dd6..6ca6a28 100644 --- a/templates/libraries/google-api-client/api.mustache +++ b/templates/libraries/google-api-client/api.mustache @@ -14,7 +14,7 @@ import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpResponse; import com.google.api.client.json.Json; -import javax.ws.rs.core.UriBuilder; +import {{javaxPackage}}.ws.rs.core.UriBuilder; import java.io.IOException; import java.util.Collection; import java.util.HashMap; @@ -121,7 +121,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); }{{#bodyParam}} @@ -199,7 +199,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); } diff --git a/templates/libraries/google-api-client/api_test.mustache b/templates/libraries/google-api-client/api_test.mustache index 1dc2f17..bfb939f 100644 --- a/templates/libraries/google-api-client/api_test.mustache +++ b/templates/libraries/google-api-client/api_test.mustache @@ -4,26 +4,26 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@Ignore public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** * {{summary}} * @@ -37,9 +37,12 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // uncomment below to test the API function + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/templates/libraries/google-api-client/build.gradle.mustache b/templates/libraries/google-api-client/build.gradle.mustache index 6341f02..c879831 100644 --- a/templates/libraries/google-api-client/build.gradle.mustache +++ b/templates/libraries/google-api-client/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -110,19 +98,16 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" - junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} + junit_version = "4.13.2" } dependencies { @@ -137,16 +122,11 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} diff --git a/templates/libraries/google-api-client/build.sbt.mustache b/templates/libraries/google-api-client/build.sbt.mustache index 721b638..78da21f 100644 --- a/templates/libraries/google-api-client/build.sbt.mustache +++ b/templates/libraries/google-api-client/build.sbt.mustache @@ -12,23 +12,18 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10" % "compile", {{/withXml}} {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", {{/joda}} - {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - {{/threetenbp}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/templates/libraries/google-api-client/pom.mustache b/templates/libraries/google-api-client/pom.mustache index 81e0ee4..97c5123 100644 --- a/templates/libraries/google-api-client/pom.mustache +++ b/templates/libraries/google-api-client/pom.mustache @@ -63,17 +63,16 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest @@ -144,28 +143,17 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -217,11 +205,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -254,7 +251,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} {{#openApiNullable}} @@ -271,13 +268,11 @@ ${jackson-version} {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -290,13 +285,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -306,30 +294,37 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.22 - 1.32.2 - 2.25.1 - 2.12.1 - 2.10.5.1 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.2.0 + 2.40 + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} 1.0.0 - 4.13.1 + 5.10.2 diff --git a/templates/libraries/jersey2/AbstractOpenApiSchema.mustache b/templates/libraries/jersey2/AbstractOpenApiSchema.mustache index 00253cc..d92c85e 100644 --- a/templates/libraries/jersey2/AbstractOpenApiSchema.mustache +++ b/templates/libraries/jersey2/AbstractOpenApiSchema.mustache @@ -6,14 +6,14 @@ import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/templates/libraries/jersey2/ApiClient.mustache b/templates/libraries/jersey2/ApiClient.mustache index d5835c1..09563af 100644 --- a/templates/libraries/jersey2/ApiClient.mustache +++ b/templates/libraries/jersey2/ApiClient.mustache @@ -1,15 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; {{#hasOAuthMethods}} import com.github.scribejava.core.model.OAuth2AccessToken; @@ -38,6 +40,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -45,18 +48,16 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.net.URLEncoder; @@ -79,87 +80,98 @@ import {{invokerPackage}}.auth.ApiKeyAuth; import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} -import com.dropbox.sign.model.ErrorResponse; - /** *

ApiClient class.

*/ {{>generatedAnnotation}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "{{{basePath}}}"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( -{{/-first}} new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} ){{/-last}}{{/servers}}); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ + {{^hasOperationServers}} + protected Map> operationServers = new HashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} {{#operation}} {{#servers}} {{#-first}} - put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList( + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( {{/-first}} - new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} - )));{{/-last}} + ))); + {{/-last}} {{/servers}} {{/operation}} {{/operations}} {{/apis}} {{/apiInfo}} - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -196,7 +208,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; {{#authMethods}} if (authMap != null) { @@ -234,7 +246,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (auth instanceof OAuth) { authentications.put("{{name}}", auth); } else { - authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}")); + authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}")); } {{/isOAuth}} {{/authMethods}} @@ -242,7 +254,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} } @@ -258,7 +270,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Getter for the field httpClient.

* - * @return a {@link javax.ws.rs.client.Client} object. + * @return a {@link {{javaxPackage}}.ws.rs.client.Client} object. */ public Client getHttpClient() { return httpClient; @@ -267,8 +279,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Setter for the field httpClient.

* - * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -288,7 +300,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -311,7 +323,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -332,7 +344,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -353,7 +365,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -400,7 +412,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -416,7 +428,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -432,7 +444,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -448,7 +460,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -456,9 +468,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (auth instanceof ApiKeyAuth) { String name = authEntry.getKey(); // respect x-auth-id-alias property - name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name; - if (secrets.containsKey(name)) { - ((ApiKeyAuth) auth).setApiKey(secrets.get(name)); + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); } } } @@ -469,7 +482,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -485,7 +498,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -502,7 +515,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -519,7 +532,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -531,12 +544,28 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * * @param username the user name * @param password the user password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -552,7 +581,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -568,7 +597,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -585,7 +614,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -607,7 +636,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -619,7 +648,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -639,7 +668,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -661,7 +690,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -685,7 +714,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -707,7 +736,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -730,7 +759,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -751,7 +780,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -797,9 +826,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -820,14 +849,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; @@ -879,14 +908,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -898,8 +926,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -919,8 +947,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -964,7 +992,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { File file = (File) param.getValue(); FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) .fileName(file.getName()).size(file.length()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); } else { FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); @@ -1058,11 +1096,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return file; } - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - // read the entity stream multiple times response.bufferEntity(); @@ -1089,7 +1122,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Prepare the file for download from the response.

* - * @param response a {@link javax.ws.rs.core.Response} object. + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. * @return a {@link java.io.File} object. * @throws java.io.IOException if any. */ @@ -1164,14 +1197,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { boolean isBodyNullable) throws ApiException { - // Not using `.target(targetURL).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" String targetURL; - if (serverIndex != null && operationServers.containsKey(operation)) { - Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex; - Map variables = operationServerVariables.containsKey(operation) ? - operationServerVariables.get(operation) : serverVariables; - List serverConfigurations = operationServers.get(operation); + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( @@ -1182,6 +1212,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { targetURL = this.basePath + path; } + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" WebTarget target = httpClient.target(targetURL); if (queryParams != null) { @@ -1192,11 +1224,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } - Invocation.Builder invocationBuilder; + Invocation.Builder invocationBuilder = target.request(); + if (accept != null) { - invocationBuilder = target.request().accept(accept); - } else { - invocationBuilder = target.request(); + invocationBuilder = invocationBuilder.accept(accept); } for (Entry entry : cookieParams.entrySet()) { @@ -1219,15 +1250,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1241,9 +1279,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { try { response = sendRequest(method, invocationBuilder, entity); + final int statusCode = response.getStatusInfo().getStatusCode(); + {{#hasOAuthMethods}} // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (response.getStatusInfo() == Status.UNAUTHORIZED) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1259,10 +1299,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } {{/hasOAuthMethods}} - int statusCode = response.getStatusInfo().getStatusCode(); Map> responseHeaders = buildResponseHeaders(response); - if (response.getStatusInfo() == Status.NO_CONTENT) { + if (statusCode == Status.NO_CONTENT.getStatusCode()) { return new ApiResponse(statusCode, responseHeaders); } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { if (returnType == null) { @@ -1273,23 +1312,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { String message = "error"; String respBody = null; - ErrorResponse errorResponse = null; if (response.hasEntity()) { try { - if (response.getStatusInfo().getFamily() == Status.Family.CLIENT_ERROR) { - errorResponse = response.readEntity(ErrorResponse.class); - respBody = errorResponse.toString(); - message = respBody; - } else { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; } catch (RuntimeException e) { // e.printStackTrace(); } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); + response.getStatus(), message, buildResponseHeaders(response), respBody); } } finally { try { @@ -1335,8 +1367,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { clientConfig = getDefaultClientConfig(); ClientBuilder clientBuilder = ClientBuilder.newBuilder(); - customizeClientBuilder(clientBuilder); clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); return clientBuilder.build(); } @@ -1380,7 +1412,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * To completely disable certificate validation (at your own risk), you can * override this method and invoke disableCertificateValidation(clientBuilder). * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. */ protected void customizeClientBuilder(ClientBuilder clientBuilder) { // No-op extension point @@ -1392,7 +1424,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Please note that trusting all certificates is extremely risky. * This may be useful in a development environment with self-signed certificates. * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. * @throws java.security.KeyManagementException if any. * @throws java.security.NoSuchAlgorithmException if any. */ @@ -1419,14 +1451,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Build the response headers.

* - * @param response a {@link javax.ws.rs.core.Response} object. + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/templates/libraries/jersey2/JSON.mustache b/templates/libraries/jersey2/JSON.mustache index f132a31..97cee63 100644 --- a/templates/libraries/jersey2/JSON.mustache +++ b/templates/libraries/jersey2/JSON.mustache @@ -1,23 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -27,40 +21,31 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.ext.ContextResolver; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; {{>generatedAnnotation}} public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - JsonMapper.builder().configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} - mapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#joda}} - mapper.registerModule(new JodaModule()); - {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} - {{#openApiNullable}} - JsonNullableModule jnm = new JsonNullableModule(); - mapper.registerModule(jnm); - {{/openApiNullable}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); } /** @@ -93,7 +78,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -113,7 +98,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -197,6 +182,7 @@ public class JSON implements ContextResolver { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. return true; } if (visitedClasses.contains(modelClass)) { @@ -207,9 +193,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -221,12 +207,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -246,7 +232,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/templates/libraries/jersey2/additional_properties.mustache b/templates/libraries/jersey2/additional_properties.mustache index 61973dc..2955e93 100644 --- a/templates/libraries/jersey2/additional_properties.mustache +++ b/templates/libraries/jersey2/additional_properties.mustache @@ -13,7 +13,7 @@ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/templates/libraries/jersey2/anyof_model.mustache b/templates/libraries/jersey2/anyof_model.mustache index d5b3819..d480667 100644 --- a/templates/libraries/jersey2/anyof_model.mustache +++ b/templates/libraries/jersey2/anyof_model.mustache @@ -1,5 +1,5 @@ -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -24,7 +24,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -134,7 +134,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -166,7 +166,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#anyOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/templates/libraries/jersey2/api.mustache b/templates/libraries/jersey2/api.mustache index dc965e1..8d3e62f 100644 --- a/templates/libraries/jersey2/api.mustache +++ b/templates/libraries/jersey2/api.mustache @@ -6,18 +6,22 @@ import {{invokerPackage}}.ApiResponse; import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Pair; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} public class {{classname}} { @@ -86,8 +90,6 @@ public class {{classname}} { } {{/vendorExtensions.x-group-parameters}} - __OVERLOAD_DELIMITER { "class": "{{classname}}", "method": "{{operationId}}", "returnType": "{{#returnType}}{{.}}{{/returnType}}", "parameters": [ {{#allParams}}{ "type": "{{{dataType}}}", "name": "{{paramName}}", "required": {{#required}}true{{/required}}{{^required}}false{{/required}}, "value": {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}"{{/isString}}{{{.}}}{{#isString}}"{{/isString}}{{/defaultValue}} }{{^-last}},{{/-last}}{{/allParams}} ]} - {{^vendorExtensions.x-group-parameters}} /** * {{summary}} @@ -118,72 +120,90 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#allParams}}{{^required}}{{#defaultValue}} - if ({{paramName}} == null) { - {{paramName}} = {{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}; - }{{/defaultValue}}{{/required}}{{/allParams}} - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/required}} + {{/allParams}} - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + Map localVarCookieParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} + {{#formParams}} + {{#-first}} + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - - localVarFormParams = {{#bodyParam}}{{paramName}}.createFormData(){{/bodyParam}}{{^bodyParam}}new {{javaUtilPrefix}}HashMap(){{/bodyParam}}; - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } {{#vendorExtensions.x-group-parameters}} public class API{{operationId}}Request { {{#allParams}} - private {{#isRequired}}final {{/isRequired}}{{{dataType}}} {{paramName}}; + private {{{dataType}}} {{paramName}}; {{/allParams}} private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) { diff --git a/templates/libraries/jersey2/apiException.mustache b/templates/libraries/jersey2/apiException.mustache index 84b4567..d103223 100644 --- a/templates/libraries/jersey2/apiException.mustache +++ b/templates/libraries/jersey2/apiException.mustache @@ -2,7 +2,6 @@ package {{invokerPackage}}; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; {{#caseInsensitiveResponseHeaders}} @@ -15,10 +14,11 @@ import java.util.TreeMap; */ {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - private ErrorResponse errorResponse; public ApiException() {} @@ -72,11 +72,6 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us this.responseBody = responseBody; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { - this(code, message, responseHeaders, responseBody); - this.errorResponse = errorResponse; - } - /** * Get the HTTP status code. * @@ -103,8 +98,4 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } - - public ErrorResponse getErrorResponse() { - return errorResponse; - } } diff --git a/templates/libraries/jersey2/api_doc.mustache b/templates/libraries/jersey2/api_doc.mustache index 3994b56..26c9850 100644 --- a/templates/libraries/jersey2/api_doc.mustache +++ b/templates/libraries/jersey2/api_doc.mustache @@ -4,9 +4,9 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -28,15 +28,74 @@ Method | HTTP request | Description ### Example ```java -REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE +{{#vendorExtensions.x-java-import}} +import {{.}}; +{{/vendorExtensions.x-java-import}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.model.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} ``` ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/templates/libraries/jersey2/api_test.mustache b/templates/libraries/jersey2/api_test.mustache index c325e3d..7b8214b 100644 --- a/templates/libraries/jersey2/api_test.mustache +++ b/templates/libraries/jersey2/api_test.mustache @@ -6,18 +6,21 @@ import {{invokerPackage}}.*; import {{invokerPackage}}.auth.*; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ @@ -28,12 +31,15 @@ public class {{classname}}Test { {{#operations}} {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * - * @throws ApiException - * if the Api call fails + {{/notes}} + * @throws ApiException if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { diff --git a/templates/libraries/jersey2/auth/HttpBasicAuth.mustache b/templates/libraries/jersey2/auth/HttpBasicAuth.mustache index 898bb97..13cecfa 100644 --- a/templates/libraries/jersey2/auth/HttpBasicAuth.mustache +++ b/templates/libraries/jersey2/auth/HttpBasicAuth.mustache @@ -5,22 +5,13 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; import {{invokerPackage}}.ApiException; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.net.URI; import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -48,15 +39,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/templates/libraries/jersey2/auth/OAuth.mustache b/templates/libraries/jersey2/auth/OAuth.mustache index 62b573a..6617522 100644 --- a/templates/libraries/jersey2/auth/OAuth.mustache +++ b/templates/libraries/jersey2/auth/OAuth.mustache @@ -10,7 +10,7 @@ import com.github.scribejava.core.exceptions.OAuthException; import com.github.scribejava.core.model.OAuth2AccessToken; import com.github.scribejava.core.oauth.OAuth20Service; -import javax.ws.rs.core.UriBuilder; +import {{javaxPackage}}.ws.rs.core.UriBuilder; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; @@ -26,7 +26,7 @@ public class OAuth implements Authentication { private String tokenUrl; private String absoluteTokenUrl; - private OAuthFlow flow = OAuthFlow.application; + private OAuthFlow flow = OAuthFlow.APPLICATION; private OAuth20Service service; private DefaultApi20 authApi; private String scope; @@ -99,22 +99,22 @@ public class OAuth implements Authentication { return service.refreshAccessToken(refreshToken); } } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { - log.log(Level.FINE, "Refreshing the access token using the refresh token failed", e); + throw new ApiException("Refreshing the access token using the refresh token failed: " + e.toString()); } try { switch (flow) { - case password: + case PASSWORD: if (username != null && password != null) { accessToken = service.getAccessTokenPasswordGrant(username, password, scope); } break; - case accessCode: + case ACCESS_CODE: if (code != null) { accessToken = service.getAccessToken(code); code = null; } break; - case application: + case APPLICATION: accessToken = service.getAccessTokenClientCredentialsGrant(scope); break; default: @@ -158,15 +158,28 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { - this.flow = OAuthFlow.password; + this.flow = OAuthFlow.PASSWORD; this.username = username; this.password = password; return this; } public OAuth useAuthorizationCodeFlow(String code) { - this.flow = OAuthFlow.accessCode; + this.flow = OAuthFlow.ACCESS_CODE; this.code = code; return this; } diff --git a/templates/libraries/jersey2/auth/OAuthFlow.mustache b/templates/libraries/jersey2/auth/OAuthFlow.mustache index 002e957..190781f 100644 --- a/templates/libraries/jersey2/auth/OAuthFlow.mustache +++ b/templates/libraries/jersey2/auth/OAuthFlow.mustache @@ -2,6 +2,12 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ public enum OAuthFlow { - accessCode, implicit, password, application + ACCESS_CODE, + IMPLICIT, + PASSWORD, + APPLICATION } diff --git a/templates/libraries/jersey2/build.gradle.mustache b/templates/libraries/jersey2/build.gradle.mustache index 76671e7..a9ab962 100644 --- a/templates/libraries/jersey2/build.gradle.mustache +++ b/templates/libraries/jersey2/build.gradle.mustache @@ -1,144 +1,125 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' } } -plugins { - id 'com.vanniktech.maven.publish' version '0.24.0' +repositories { + mavenCentral() } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'com.diffplug.spotless' -apply plugin: 'signing' +if(hasProperty('target') && target == 'android') { -group = '{{groupId}}' -archivesBaseName = '{{artifactId}}' -version = '{{artifactVersion}}' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' -repositories { - mavenCentral() -} + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection - options.addStringOption('Xdoclint:none', '-quiet') + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } } -} -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } -task fatJar(type: Jar) { - classifier = 'all' - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - from { - configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + artifacts { + archives sourcesJar } - with jar -} -processResources { - expand(project.properties) -} +} else { -artifacts { - archives javadocJar, sourcesJar, fatJar -} + apply plugin: 'java' + apply plugin: 'maven-publish' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = '{{artifactId}}' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = '{{scmConnection}}' - developerConnection = '{{scmDeveloperConnection}}' - url = '{{scmUrl}}' - } + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' - licenses { - license { - name = '{{licenseName}}' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = '{{developerName}}' - email = '{{developerEmail}}' - url = 'https://www.hellosign.com' - } - } + from components.java } } } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.6.3" - jackson_version = "2.13.0" - jackson_databind_version = "2.13.0" + swagger_annotations_version = "1.6.5" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "2.35" - junit_version = "4.13.2" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.8.2" {{#hasOAuthMethods}} scribejava_apis_version = "8.3.1" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} - mockito_version = "3.12.4" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation 'commons-codec:commons-codec:1.15' implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.glassfish.jersey.core:jersey-client:$jersey_version" implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version" @@ -154,24 +135,23 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#hasOAuthMethods}} implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" - testImplementation "org.mockito:mockito-core:$mockito_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } javadoc { diff --git a/templates/libraries/jersey2/build.sbt.mustache b/templates/libraries/jersey2/build.sbt.mustache index d296ad4..d055cf3 100644 --- a/templates/libraries/jersey2/build.sbt.mustache +++ b/templates/libraries/jersey2/build.sbt.mustache @@ -9,28 +9,22 @@ lazy val root = (project in file(".")). Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - libraryDependencies += "commons-codec" % "commons-codec" % "1.15" "com.google.code.findbugs" % "jsr305" % "3.0.0", - "io.swagger" % "swagger-annotations" % "1.6.3", + "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "2.35", "org.glassfish.jersey.inject" % "jersey-hk2" % "2.35", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.0" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", @@ -38,11 +32,7 @@ lazy val root = (project in file(".")). {{#hasHttpSignatureMethods}} "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} - {{^java8}} - "com.brsanthu" % "migbase64" % "2.2", - {{/java8}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/templates/libraries/jersey2/model.mustache b/templates/libraries/jersey2/model.mustache index c5abf57..1904ee4 100644 --- a/templates/libraries/jersey2/model.mustache +++ b/templates/libraries/jersey2/model.mustache @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/model}} {{/models}} import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; {{#imports}} @@ -28,8 +27,6 @@ import java.io.Serializable; {{/serializableModel}} {{#jackson}} import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} @@ -38,15 +35,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; {{/withXml}} {{#parcelableModel}} import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/templates/libraries/jersey2/model_test.mustache b/templates/libraries/jersey2/model_test.mustache new file mode 100644 index 0000000..acd659b --- /dev/null +++ b/templates/libraries/jersey2/model_test.mustache @@ -0,0 +1,44 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/templates/libraries/jersey2/oneof_model.mustache b/templates/libraries/jersey2/oneof_model.mustache index 18bcbc5..09906d7 100644 --- a/templates/libraries/jersey2/oneof_model.mustache +++ b/templates/libraries/jersey2/oneof_model.mustache @@ -1,5 +1,5 @@ -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -26,7 +26,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,7 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#useOneOfDiscriminatorLookup}} {{#discriminator}} {{classname}} new{{classname}} = new {{classname}}(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { {{#mappedModels}} @@ -78,37 +78,74 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + {{#composedSchemas}} {{#oneOf}} - // deserialize {{{.}}} + // deserialize {{{dataType}}}{{#isNullable}} (nullable){{/isNullable}} try { + {{^isArray}} boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); - {{#isNullable}} - attemptParsing |= (token == JsonToken.VALUE_NULL); - {{/isNullable}} - } + {{#isPrimitiveType}} + attemptParsing = typeCoercion; //respect type coercion setting + if (!attemptParsing) { + {{#isString}} + attemptParsing |= (token == JsonToken.VALUE_STRING); + {{/isString}} + {{#isInteger}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isInteger}} + {{#isLong}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isLong}} + {{#isShort}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isShort}} + {{#isFloat}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isFloat}} + {{#isDouble}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDouble}} + {{#isNumber}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isNumber}} + {{#isDecimal}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDecimal}} + {{#isBoolean}} + attemptParsing |= (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + {{/isBoolean}} + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} } + {{/isPrimitiveType}} if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{dataType}}}.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); } + {{/isArray}} + {{#isArray}} + if (token == JsonToken.START_ARRAY) { + final TypeReference<{{{dataType}}}> ref = new TypeReference<{{{dataType}}}>(){}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(ref); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} } catch (Exception e) { // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); } {{/oneOf}} + {{/composedSchemas}} if (match == 1) { {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -132,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -152,13 +189,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} + {{#composedSchemas}} {{#oneOf}} - public {{classname}}({{{.}}} o) { + {{^vendorExtensions.x-duplicated-data-type}} + public {{classname}}({{{baseType}}} o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} static { {{#oneOf}} schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { @@ -167,7 +208,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -177,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -198,13 +239,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} + {{#composedSchemas}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + {{^vendorExtensions.x-duplicated-data-type}} + if (JSON.isInstanceOf({{{baseType}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @@ -219,17 +264,26 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return super.getActualInstance(); } + {{#composedSchemas}} {{#oneOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + {{^isArray}} + public {{{dataType}}} get{{{dataType}}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } + {{/isArray}} + {{#isArray}} + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} {{/oneOf}} + {{/composedSchemas}} } diff --git a/templates/libraries/jersey2/pojo.mustache b/templates/libraries/jersey2/pojo.mustache index 4dea6ca..06be4dd 100644 --- a/templates/libraries/jersey2/pojo.mustache +++ b/templates/libraries/jersey2/pojo.mustache @@ -1,19 +1,32 @@ -import com.dropbox.sign.ApiException; /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} - {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) -@JsonIgnoreProperties(ignoreUnknown=true) +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -39,44 +52,36 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -93,24 +98,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public {{classname}} init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, {{classname}}.class); - } - - static public {{classname}} init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - {{classname}}.class - ); - } {{#vars}} {{^isReadOnly}} @@ -120,6 +110,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens )); {{/vendorExtensions.x-enum-as-string}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { @@ -135,18 +128,12 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} return this; } - {{#vendorExtensions.x-int-or-string}} - public {{classname}} {{name}}(Integer {{name}}) { - this.{{name}} = String.valueOf({{name}}); - return this; - } - {{/vendorExtensions.x-int-or-string}} {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -156,11 +143,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -168,10 +153,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -181,11 +166,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -193,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -210,22 +193,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -262,6 +253,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} @@ -277,12 +271,6 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens this.{{name}} = {{name}}; {{/vendorExtensions.x-is-jackson-optional-nullable}} } - {{#vendorExtensions.x-int-or-string}} - - public void {{setter}}(Integer {{name}}) { - this.{{name}} = String.valueOf({{name}}); - } - {{/vendorExtensions.x-int-or-string}} {{/isReadOnly}} {{/vars}} @@ -340,7 +328,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -349,61 +337,6 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return sb.toString(); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - {{#parent}} - map.putAll(super.createFormData()); - {{/parent}} - try { - {{#vars}} - if ({{name}} != null) { - if (isFileTypeOrListOfFiles({{name}})) { - fileTypeFound = true; - } - - if ({{name}}.getClass().equals(java.io.File.class) || - {{name}}.getClass().equals(Integer.class) || - {{name}}.getClass().equals(String.class) || - {{name}}.getClass().isEnum()) { - map.put("{{baseName}}", {{name}}); - } else if (isListOfFile({{name}})) { - for(int i = 0; i< getListSize({{name}}); i++) { - map.put("{{baseName}}[" + i + "]", getFromList({{name}}, i)); - } - } - else { - map.put("{{baseName}}", JSON.getDefault().getMapper().writeValueAsString({{name}})); - } - } - {{/vars}} - } catch (Exception e) { - throw new ApiException(e); - } - - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } - - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } - - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } - /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). @@ -456,7 +389,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return 0; } - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<>() { public {{classname}} createFromParcel(Parcel in) { {{#model}} {{#isArray}} @@ -475,14 +408,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }; {{/parcelableModel}} {{#discriminator}} -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - {{#mappedModels}} - mappings.put("{{mappingName}}", {{modelName}}.class); - {{/mappedModels}} - mappings.put("{{name}}", {{classname}}.class); - JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + } {{/discriminator}} } diff --git a/templates/libraries/jersey2/pom.mustache b/templates/libraries/jersey2/pom.mustache index 15bae37..214d3ce 100644 --- a/templates/libraries/jersey2/pom.mustache +++ b/templates/libraries/jersey2/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -91,27 +91,11 @@ - - maven-assembly-plugin - - - package - - single - - - - - - jar-with-dependencies - - - org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.2.2 @@ -125,7 +109,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -156,7 +140,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 1.8 1.8 @@ -172,7 +156,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 attach-javadocs @@ -257,7 +241,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -274,17 +258,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} - + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} - commons-codec - commons-codec - 1.15 + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + {{/swagger2AnnotationLibrary}} @@ -358,13 +345,6 @@ jackson-datatype-jsr310 ${jackson-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -401,40 +381,40 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test - - org.mockito - mockito-core - ${mockito.version} - test - UTF-8 - 1.6.3 - 2.35 - 2.13.0 - 2.13.0 - 0.2.2 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.37 + 2.17.1 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - 4.13.2 + 5.10.0 {{#hasHttpSignatureMethods}} - 1.7 + 1.8 {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} - 8.3.1 + 8.3.3 {{/hasOAuthMethods}} - 2.17.3 - 3.12.4 + 2.21.0 diff --git a/templates/libraries/jersey3/AbstractOpenApiSchema.mustache b/templates/libraries/jersey3/AbstractOpenApiSchema.mustache index 417745b..d92c85e 100644 --- a/templates/libraries/jersey3/AbstractOpenApiSchema.mustache +++ b/templates/libraries/jersey3/AbstractOpenApiSchema.mustache @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/templates/libraries/jersey3/ApiClient.mustache b/templates/libraries/jersey3/ApiClient.mustache index f645d98..344a2ec 100644 --- a/templates/libraries/jersey3/ApiClient.mustache +++ b/templates/libraries/jersey3/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{javaxPackage}}.ws.rs.client.Client; @@ -55,12 +57,7 @@ import java.util.Date; import java.util.stream.Collectors; import java.util.stream.Stream; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.net.URLEncoder; @@ -82,8 +79,9 @@ import {{invokerPackage}}.auth.ApiKeyAuth; {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} - +{{#useCustomTemplateCode}} import com.dropbox.sign.model.ErrorResponse; +{{/useCustomTemplateCode}} /** *

ApiClient class.

@@ -126,13 +124,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected Integer serverIndex = 0; protected Map serverVariables = null; {{^hasOperationServers}} - protected Map> operationServers = new LinkedHashMap<>(); + protected Map> operationServers = new HashMap<>(); {{/hasOperationServers}} {{#hasOperationServers}} protected Map> operationServers; { - Map> operationServers = new LinkedHashMap<>(); + Map> operationServers = new HashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} @@ -285,7 +283,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field httpClient.

* * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -305,7 +303,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -328,7 +326,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -349,7 +347,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -370,7 +368,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -417,7 +415,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -433,7 +431,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -449,10 +447,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { +{{^useCustomTemplateCode}} + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(apiKey); return this; @@ -460,6 +465,45 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { ((ApiKeyAuth) auth).setApiKey(apiKey); return this; } +{{/useCustomTemplateCode}} + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } } throw new RuntimeException("No API key authentication configured!"); } @@ -468,7 +512,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -485,7 +529,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -502,7 +546,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -518,7 +562,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -535,7 +579,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -551,7 +595,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -567,7 +611,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -584,7 +628,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -606,7 +650,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -618,7 +662,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -638,7 +682,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -660,7 +704,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -684,7 +728,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -706,7 +750,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -729,7 +773,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -750,7 +794,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -796,9 +840,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -824,9 +868,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; @@ -1282,7 +1326,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { String message = "error"; String respBody = null; +{{#useCustomTemplateCode}} ErrorResponse errorResponse = null; +{{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (response.hasEntity()) { try { if (response.getStatusInfo().getFamily() == Status.Family.CLIENT_ERROR) { @@ -1299,6 +1358,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } throw new ApiException( response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); +{{/useCustomTemplateCode}} } } finally { try { diff --git a/templates/libraries/jersey3/JSON.mustache b/templates/libraries/jersey3/JSON.mustache index 162a9b9..e1f17c9 100644 --- a/templates/libraries/jersey3/JSON.mustache +++ b/templates/libraries/jersey3/JSON.mustache @@ -1,8 +1,7 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; @@ -13,9 +12,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -33,16 +29,15 @@ public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - {{#threetenbp}} - ThreeTenModule threeTenModule = new ThreeTenModule(); - threeTenModule.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - threeTenModule.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - threeTenModule.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - {{/threetenbp}} mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) +{{^useCustomTemplateCode}} .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) +{{/useCustomTemplateCode}} .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) @@ -52,9 +47,6 @@ public class JSON implements ContextResolver { {{#joda}} .addModule(new JodaModule()) {{/joda}} - {{#threetenbp}} - .addModule(threeTenModule) - {{/threetenbp}} {{#openApiNullable}} .addModule(new JsonNullableModule()) {{/openApiNullable}} @@ -195,7 +187,9 @@ public class JSON implements ContextResolver { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { +{{^useCustomTemplateCode}} // This handles the 'allOf' use case with single parent inheritance. +{{/useCustomTemplateCode}} return true; } if (visitedClasses.contains(modelClass)) { @@ -206,9 +200,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -225,7 +219,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -245,7 +239,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/templates/libraries/jersey3/anyof_model.mustache b/templates/libraries/jersey3/anyof_model.mustache index 8239a30..d480667 100644 --- a/templates/libraries/jersey3/anyof_model.mustache +++ b/templates/libraries/jersey3/anyof_model.mustache @@ -24,7 +24,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } diff --git a/templates/libraries/jersey3/api.mustache b/templates/libraries/jersey3/api.mustache index 3260136..1174ab1 100644 --- a/templates/libraries/jersey3/api.mustache +++ b/templates/libraries/jersey3/api.mustache @@ -11,6 +11,11 @@ import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -85,8 +90,10 @@ public class {{classname}} { } {{/vendorExtensions.x-group-parameters}} +{{#useCustomTemplateCode}} __OVERLOAD_DELIMITER { "class": "{{classname}}", "method": "{{operationId}}", "returnType": "{{#returnType}}{{.}}{{/returnType}}", "parameters": [ {{#allParams}}{ "type": "{{{dataType}}}", "name": "{{paramName}}", "required": {{#required}}true{{/required}}{{^required}}false{{/required}}, "value": {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}"{{/isString}}{{{.}}}{{#isString}}"{{/isString}}{{/defaultValue}} }{{^-last}},{{/-last}}{{/allParams}} ]} +{{/useCustomTemplateCode}} {{^vendorExtensions.x-group-parameters}} /** * {{summary}} @@ -117,66 +124,119 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { +{{#useCustomTemplateCode}} {{#allParams}}{{^required}}{{#defaultValue}} if ({{paramName}} == null) { {{paramName}} = {{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}; }{{/defaultValue}}{{/required}}{{/allParams}} - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set +{{/useCustomTemplateCode}} + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/required}} + {{/allParams}} - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + Map localVarCookieParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} +{{^useCustomTemplateCode}} + {{#formParams}} + {{#-first}} + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - +{{/useCustomTemplateCode}} + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); +{{^useCustomTemplateCode}} + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = {{#bodyParam}}{{paramName}}.createFormData(){{/bodyParam}}{{^bodyParam}}new {{javaUtilPrefix}}HashMap(){{/bodyParam}}; boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); +{{/useCustomTemplateCode}} + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); +{{^useCustomTemplateCode}} + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + return apiClient.invokeAPI( + "{{classname}}.{{operationId}}", + {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, + "{{httpMethod}}", + {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, + {{#bodyParam}}isFileTypeFound ? null : {{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, + {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, + localVarFormParams, + localVarAccept, + localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, + {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, + {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}} + ); +{{/useCustomTemplateCode}} } {{#vendorExtensions.x-group-parameters}} diff --git a/templates/libraries/jersey3/apiException.mustache b/templates/libraries/jersey3/apiException.mustache index 84b4567..70c2af5 100644 --- a/templates/libraries/jersey3/apiException.mustache +++ b/templates/libraries/jersey3/apiException.mustache @@ -2,23 +2,29 @@ package {{invokerPackage}}; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; {{#caseInsensitiveResponseHeaders}} import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} +{{#useCustomTemplateCode}} +import com.dropbox.sign.model.ErrorResponse; +{{/useCustomTemplateCode}} /** * API Exception */ {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; +{{#useCustomTemplateCode}} private ErrorResponse errorResponse; +{{/useCustomTemplateCode}} public ApiException() {} @@ -72,11 +78,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us this.responseBody = responseBody; } +{{#useCustomTemplateCode}} public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { this(code, message, responseHeaders, responseBody); this.errorResponse = errorResponse; } +{{/useCustomTemplateCode}} /** * Get the HTTP status code. * @@ -103,8 +111,10 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } +{{#useCustomTemplateCode}} public ErrorResponse getErrorResponse() { return errorResponse; } +{{/useCustomTemplateCode}} } diff --git a/templates/libraries/jersey3/api_doc.mustache b/templates/libraries/jersey3/api_doc.mustache index 3994b56..4570967 100644 --- a/templates/libraries/jersey3/api_doc.mustache +++ b/templates/libraries/jersey3/api_doc.mustache @@ -4,10 +4,16 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{^useCustomTemplateCode}} +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} @@ -28,16 +34,86 @@ Method | HTTP request | Description ### Example ```java +{{^useCustomTemplateCode}} +{{#vendorExtensions.x-java-import}} +import {{.}}; +{{/vendorExtensions.x-java-import}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.model.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE +{{/useCustomTemplateCode}} ``` ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{^useCustomTemplateCode}} +{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/templates/libraries/jersey3/api_test.mustache b/templates/libraries/jersey3/api_test.mustache index ea9e7d1..7b8214b 100644 --- a/templates/libraries/jersey3/api_test.mustache +++ b/templates/libraries/jersey3/api_test.mustache @@ -7,20 +7,20 @@ import {{invokerPackage}}.auth.*; {{#imports}}import {{import}}; {{/imports}} -{{! TODO use latest JUnit }} -{{!import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test;}} - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/templates/libraries/jersey3/build.gradle.mustache b/templates/libraries/jersey3/build.gradle.mustache index 9a856a7..5be97a1 100644 --- a/templates/libraries/jersey3/build.gradle.mustache +++ b/templates/libraries/jersey3/build.gradle.mustache @@ -1,3 +1,12 @@ +{{^useCustomTemplateCode}} +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' +{{/useCustomTemplateCode}} + buildscript { repositories { mavenCentral() @@ -9,6 +18,7 @@ buildscript { } } +{{#useCustomTemplateCode}} plugins { id 'com.vanniktech.maven.publish' version '0.24.0' } @@ -24,10 +34,90 @@ version = '{{artifactVersion}}' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 +{{/useCustomTemplateCode}} repositories { mavenCentral() } +{{^useCustomTemplateCode}} +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } @@ -113,29 +203,30 @@ publishing { } } } +{{/useCustomTemplateCode}} ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "2.1.0" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "3.0.4" - {{! TODO use latest version of junit }} - {{!junit_version = "5.8.2"}} - junit_version = "4.13.1" + junit_version = "5.8.2" {{#hasOAuthMethods}} scribejava_apis_version = "8.3.1" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} +{{#useCustomTemplateCode}} mockito_version = "3.12.4" +{{/useCustomTemplateCode}} } dependencies { @@ -155,32 +246,28 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#hasOAuthMethods}} implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - {{! TODO use latest version of junit }} - {{!testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"}} - testImplementation "junit:junit:$junit_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} + + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +{{#useCustomTemplateCode}} testImplementation "org.mockito:mockito-core:$mockito_version" +{{/useCustomTemplateCode}} } -{{! TODO use latest version of junit (uncomment the below) }} -{{! test { useJUnitPlatform() } -}} javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] diff --git a/templates/libraries/jersey3/build.sbt.mustache b/templates/libraries/jersey3/build.sbt.mustache index ed294c0..e4c37f9 100644 --- a/templates/libraries/jersey3/build.sbt.mustache +++ b/templates/libraries/jersey3/build.sbt.mustache @@ -9,6 +9,9 @@ lazy val root = (project in file(".")). Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( +{{#useCustomTemplateCode}} + libraryDependencies += "commons-codec" % "commons-codec" % "1.15" +{{/useCustomTemplateCode}} "com.google.code.findbugs" % "jsr305" % "3.0.0", "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "3.0.4", @@ -16,16 +19,13 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} @@ -36,8 +36,6 @@ lazy val root = (project in file(".")). "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", - {{! TODO use the latest JUnit }} - {{! "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" }} - "junit" % "junit" % "4.13.2" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/templates/libraries/jersey3/generatedAnnotation.mustache b/templates/libraries/jersey3/generatedAnnotation.mustache index f408f31..e05689d 100644 --- a/templates/libraries/jersey3/generatedAnnotation.mustache +++ b/templates/libraries/jersey3/generatedAnnotation.mustache @@ -1 +1 @@ -@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/templates/libraries/jersey3/model.mustache b/templates/libraries/jersey3/model.mustache index 707d0ad..5098577 100644 --- a/templates/libraries/jersey3/model.mustache +++ b/templates/libraries/jersey3/model.mustache @@ -22,15 +22,11 @@ import java.util.HashMap; {{#imports}} import {{import}}; {{/imports}} -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} {{#jackson}} import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} @@ -46,13 +42,17 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; {{/performBeanValidation}} import {{invokerPackage}}.JSON; +{{#useCustomTemplateCode}} +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; +{{/useCustomTemplateCode}} {{#models}} {{#model}} diff --git a/templates/libraries/jersey3/model_test.mustache b/templates/libraries/jersey3/model_test.mustache index cd926fb..acd659b 100644 --- a/templates/libraries/jersey3/model_test.mustache +++ b/templates/libraries/jersey3/model_test.mustache @@ -5,14 +5,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -{{! TODO use latest JUnit }} -{{!import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test;}} - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for {{classname}} diff --git a/templates/libraries/jersey3/oneof_model.mustache b/templates/libraries/jersey3/oneof_model.mustache index de29a87..09906d7 100644 --- a/templates/libraries/jersey3/oneof_model.mustache +++ b/templates/libraries/jersey3/oneof_model.mustache @@ -26,7 +26,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,7 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#useOneOfDiscriminatorLookup}} {{#discriminator}} {{classname}} new{{classname}} = new {{classname}}(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { {{#mappedModels}} @@ -78,37 +78,74 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + {{#composedSchemas}} {{#oneOf}} - // deserialize {{{.}}} + // deserialize {{{dataType}}}{{#isNullable}} (nullable){{/isNullable}} try { + {{^isArray}} boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); - {{#isNullable}} - attemptParsing |= (token == JsonToken.VALUE_NULL); - {{/isNullable}} - } + {{#isPrimitiveType}} + attemptParsing = typeCoercion; //respect type coercion setting + if (!attemptParsing) { + {{#isString}} + attemptParsing |= (token == JsonToken.VALUE_STRING); + {{/isString}} + {{#isInteger}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isInteger}} + {{#isLong}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isLong}} + {{#isShort}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isShort}} + {{#isFloat}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isFloat}} + {{#isDouble}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDouble}} + {{#isNumber}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isNumber}} + {{#isDecimal}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDecimal}} + {{#isBoolean}} + attemptParsing |= (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + {{/isBoolean}} + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} } + {{/isPrimitiveType}} if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{dataType}}}.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); } + {{/isArray}} + {{#isArray}} + if (token == JsonToken.START_ARRAY) { + final TypeReference<{{{dataType}}}> ref = new TypeReference<{{{dataType}}}>(){}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(ref); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} } catch (Exception e) { // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); } {{/oneOf}} + {{/composedSchemas}} if (match == 1) { {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -132,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -152,13 +189,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} + {{#composedSchemas}} {{#oneOf}} - public {{classname}}({{{.}}} o) { + {{^vendorExtensions.x-duplicated-data-type}} + public {{classname}}({{{baseType}}} o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} static { {{#oneOf}} schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { @@ -177,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -198,13 +239,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} + {{#composedSchemas}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { + {{^vendorExtensions.x-duplicated-data-type}} + if (JSON.isInstanceOf({{{baseType}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @@ -219,17 +264,26 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return super.getActualInstance(); } + {{#composedSchemas}} {{#oneOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + {{^isArray}} + public {{{dataType}}} get{{{dataType}}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } + {{/isArray}} + {{#isArray}} + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} {{/oneOf}} + {{/composedSchemas}} } diff --git a/templates/libraries/jersey3/pojo.mustache b/templates/libraries/jersey3/pojo.mustache index af7752f..0ba5ad0 100644 --- a/templates/libraries/jersey3/pojo.mustache +++ b/templates/libraries/jersey3/pojo.mustache @@ -1,4 +1,6 @@ +{{#useCustomTemplateCode}} import com.dropbox.sign.ApiException; +{{/useCustomTemplateCode}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} @@ -20,7 +22,6 @@ import com.dropbox.sign.ApiException; {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) -@JsonIgnoreProperties(ignoreUnknown=true) {{#isClassnameSanitized}} @JsonTypeName("{{name}}") {{/isClassnameSanitized}} @@ -29,6 +30,13 @@ import com.dropbox.sign.ApiException; {{#vendorExtensions.x-class-extra-annotation}} {{{vendorExtensions.x-class-extra-annotation}}} {{/vendorExtensions.x-class-extra-annotation}} +{{#useCustomTemplateCode}} +{{^parent}} +{{^discriminator}} +@JsonIgnoreProperties(ignoreUnknown=true) +{{/discriminator}} +{{/parent}} +{{/useCustomTemplateCode}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -54,25 +62,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -82,14 +75,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#deprecated}} + @Deprecated + {{/deprecated}} +{{^useCustomTemplateCode}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{/isContainer}} + {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} +{{/useCustomTemplateCode}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -106,9 +118,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} +{{#useCustomTemplateCode}} /** * Attempt to instantiate and hydrate a new instance of this class @@ -124,6 +137,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{classname}}.class ); } +{{/useCustomTemplateCode}} {{#vars}} {{^isReadOnly}} @@ -133,6 +147,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens )); {{/vendorExtensions.x-enum-as-string}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { @@ -148,15 +165,17 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} return this; } +{{#useCustomTemplateCode}} {{#vendorExtensions.x-int-or-string}} public {{classname}} {{name}}(Integer {{name}}) { this.{{name}} = String.valueOf({{name}}); return this; } {{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -179,7 +198,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); @@ -202,7 +221,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -219,7 +238,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} @@ -279,6 +298,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} @@ -294,12 +316,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens this.{{name}} = {{name}}; {{/vendorExtensions.x-is-jackson-optional-nullable}} } +{{#useCustomTemplateCode}} {{#vendorExtensions.x-int-or-string}} public void {{setter}}(Integer {{name}}) { this.{{name}} = String.valueOf({{name}}); } {{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{/isReadOnly}} {{/vars}} @@ -357,7 +381,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -366,6 +390,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return sb.toString(); } +{{#useCustomTemplateCode}} public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; @@ -421,6 +446,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } +{{/useCustomTemplateCode}} /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). diff --git a/templates/libraries/jersey3/pom.mustache b/templates/libraries/jersey3/pom.mustache index fa0079b..e2bb172 100644 --- a/templates/libraries/jersey3/pom.mustache +++ b/templates/libraries/jersey3/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -91,6 +91,7 @@
+{{#useCustomTemplateCode}} maven-assembly-plugin @@ -107,6 +108,7 @@
+{{/useCustomTemplateCode}} org.apache.maven.plugins @@ -288,6 +290,13 @@ ${swagger-annotations-version} {{/swagger2AnnotationLibrary}} +{{#useCustomTemplateCode}} + + commons-codec + commons-codec + 1.15 + +{{/useCustomTemplateCode}} @@ -361,13 +370,6 @@ jackson-datatype-jsr310 ${jackson-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -403,25 +405,20 @@ ${jersey-version} - {{! TODO use latest version of junit }} - {{! + org.junit.jupiter junit-jupiter-api ${junit-version} test - }} - - junit - junit - ${junit-version} - test +{{#useCustomTemplateCode}} org.mockito mockito-core ${mockito.version} test +{{/useCustomTemplateCode}} UTF-8 @@ -429,29 +426,26 @@ 1.6.6 {{/swagger1AnnotationLibrary}} {{#swagger2AnnotationLibrary}} - 2.2.9 + 2.2.15 {{/swagger2AnnotationLibrary}} - 3.0.4 - 2.13.4 - 2.13.4.2 + 3.1.1 + 2.17.1 + 2.17.1 0.2.6 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 2.1.0 + 2.1.1 {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - {{! TODO use latest version of junit }} - {{!5.8.2}} - 4.13.1 + 5.10.0 {{#hasHttpSignatureMethods}} - 1.7 + 1.8 {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} - 8.3.1 + 8.3.3 {{/hasOAuthMethods}} 2.21.0 +{{#useCustomTemplateCode}} 3.12.4 +{{/useCustomTemplateCode}} diff --git a/templates/libraries/microprofile/README.mustache b/templates/libraries/microprofile/README.mustache index 58d2d5f..377dfc2 100644 --- a/templates/libraries/microprofile/README.mustache +++ b/templates/libraries/microprofile/README.mustache @@ -1,10 +1,19 @@ -# {{appName}} - MicroProfile Rest Client +# {{appName}} - MicroProfile Rest Client & MicroProfile Server {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{^microprofileServer}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. +{{/microprofileServer}} + +{{#microprofileServer}} +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +The generated server contains an interface which acts as the server, you can inject it into the controller class. +This module is intended to provide additional server features, like accessing an operations response object, when multiple responses where specified. +{{/microprofileServer}} \ No newline at end of file diff --git a/templates/libraries/microprofile/api.mustache b/templates/libraries/microprofile/api.mustache index 119494e..6e25c1f 100644 --- a/templates/libraries/microprofile/api.mustache +++ b/templates/libraries/microprofile/api.mustache @@ -9,12 +9,20 @@ import java.io.OutputStream; import java.util.List; import java.util.Map; import java.util.Set; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.MediaType; +import {{rootJavaEEPackage}}.ws.rs.*; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.MediaType; {{^disableMultipart}} import org.apache.cxf.jaxrs.ext.multipart.*; {{/disableMultipart}} +{{#microprofileMutiny}} +import io.smallrye.mutiny.Uni; +{{/microprofileMutiny}} + +{{#useBeanValidation}} +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; +{{/useBeanValidation}} import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @@ -30,7 +38,9 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; */ {{/appName}} -@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}} +{{^microprofileServer}} +@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}{{#configKeyFromClassName}}{{#operations}}(configKey="{{configKey}}"){{/operations}}{{/configKeyFromClassName}} +{{/microprofileServer}} @RegisterProvider(ApiExceptionMapper.class) @Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}") public interface {{classname}} { @@ -61,7 +71,50 @@ public interface {{classname}} { {{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{^useSingleRequestParameter}} + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileServer}}{{> server_operation}}{{/microprofileServer}}{{^microprofileServer}}{{> client_operation}}{{/microprofileServer}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{/useSingleRequestParameter}} +{{#useSingleRequestParameter}} + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#hasNonBodyParams}}@BeanParam {{operationIdCamelCase}}Request request{{/hasNonBodyParams}}{{#bodyParams}}{{#hasNonBodyParams}}, {{/hasNonBodyParams}}{{>bodyParams}}{{/bodyParams}}) throws ApiException, ProcessingException; + {{#hasNonBodyParams}} + public class {{operationIdCamelCase}}Request { + + {{#queryParams}} + private {{>queryParams}}; + {{/queryParams}} + {{#headerParams}} + private {{>headerParams}}; + {{/headerParams}} + {{#pathParams}} + private {{>pathParams}}; + {{/pathParams}} + {{#formParams}} + private {{>formParams}}; + {{/formParams}} + + private {{operationIdCamelCase}}Request() { + } + + public static {{operationIdCamelCase}}Request newInstance() { + return new {{operationIdCamelCase}}Request(); + } + + {{#allParams}} + {{^isBodyParam}} + /** + * Set {{paramName}}{{>formParamsNameSuffix}} + * @param {{paramName}}{{>formParamsNameSuffix}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}}) + * @return {{operationIdCamelCase}}Request + */ + public {{operationIdCamelCase}}Request {{paramName}}{{>formParamsNameSuffix}}({{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>formParamsImpl}}) { + this.{{paramName}}{{>formParamsNameSuffix}} = {{paramName}}{{>formParamsNameSuffix}}; + return this; + } + {{/isBodyParam}} + {{/allParams}} + } + {{/hasNonBodyParams}} +{{/useSingleRequestParameter}} {{/operation}} } {{/operations}} diff --git a/templates/libraries/microprofile/api_exception.mustache b/templates/libraries/microprofile/api_exception.mustache index fc5c5e5..63a2186 100644 --- a/templates/libraries/microprofile/api_exception.mustache +++ b/templates/libraries/microprofile/api_exception.mustache @@ -1,9 +1,9 @@ {{>licenseInfo}} package {{apiPackage}}; -import javax.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.Response; -public class ApiException extends Exception { +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ private static final long serialVersionUID = 1L; private Response response; diff --git a/templates/libraries/microprofile/api_exception_mapper.mustache b/templates/libraries/microprofile/api_exception_mapper.mustache index 9c59884..12988f5 100644 --- a/templates/libraries/microprofile/api_exception_mapper.mustache +++ b/templates/libraries/microprofile/api_exception_mapper.mustache @@ -1,9 +1,9 @@ {{>licenseInfo}} package {{apiPackage}}; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.Provider; +import {{rootJavaEEPackage}}.ws.rs.core.MultivaluedMap; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.ext.Provider; import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; @Provider diff --git a/templates/libraries/microprofile/api_test.mustache b/templates/libraries/microprofile/api_test.mustache index a53acad..d9af877 100644 --- a/templates/libraries/microprofile/api_test.mustache +++ b/templates/libraries/microprofile/api_test.mustache @@ -4,23 +4,23 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; +{{#generateSpringBootApplication}} +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.test.context.junit.jupiter.SpringExtension; +{{/generateSpringBootApplication}} import org.eclipse.microprofile.rest.client.RestClientBuilder; import java.net.URL; import java.net.MalformedURLException; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} - - /** {{#appName}} @@ -30,7 +30,7 @@ import java.util.Set; * API tests for {{classname}} */ {{#generateSpringBootApplication}} -@RunWith(SpringJUnit4ClassRunner.class) +@ExtendWith(SpringExtension.class) @SpringApplicationConfiguration(classes = SpringBootApplication.class) @WebAppConfiguration @IntegrationTest("server.port=0") @@ -40,12 +40,17 @@ public class {{classname}}Test { private {{classname}} client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { + {{#microprofile3}} + // TODO initialize the client + {{/microprofile3}} + {{^microprofile3}} client = RestClientBuilder.newBuilder() .baseUrl(new URL(baseUrl)) .register(ApiException.class) .build({{classname}}.class); + {{/microprofile3}} } {{#operations}}{{#operation}} @@ -67,8 +72,8 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - //{{#returnType}}assertNotNull(response);{{/returnType}} + //{{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}Assertions.assertNotNull(response);{{/returnType}} } diff --git a/templates/libraries/microprofile/beanValidation.mustache b/templates/libraries/microprofile/beanValidation.mustache index c8c6946..f8724b2 100644 --- a/templates/libraries/microprofile/beanValidation.mustache +++ b/templates/libraries/microprofile/beanValidation.mustache @@ -1,4 +1,6 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{>beanValidationCore}} \ No newline at end of file diff --git a/templates/libraries/microprofile/client_operation.mustache b/templates/libraries/microprofile/client_operation.mustache new file mode 100644 index 0000000..403918d --- /dev/null +++ b/templates/libraries/microprofile/client_operation.mustache @@ -0,0 +1 @@ +{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} \ No newline at end of file diff --git a/templates/libraries/microprofile/enumClass.mustache b/templates/libraries/microprofile/enumClass.mustache index 38127a6..cb8539b 100644 --- a/templates/libraries/microprofile/enumClass.mustache +++ b/templates/libraries/microprofile/enumClass.mustache @@ -3,8 +3,10 @@ @XmlEnum({{dataType}}.class) {{/withXml}} {{^withXml}} + {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) + {{/jsonb}} {{/withXml}} {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { @@ -13,7 +15,7 @@ {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{^withXml}} - {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{#enumVars}}{{name}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{/allowableValues}} @@ -24,6 +26,9 @@ value = v; } + {{#jackson}} + @JsonValue + {{/jackson}} public {{dataType}} value() { return value; } @@ -44,6 +49,7 @@ } {{/withXml}} {{^withXml}} + {{#jsonb}} public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { @@ -59,8 +65,20 @@ public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { @Override public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { - generator.write(obj.value); + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); } } + {{/jsonb}} + {{#jackson}} + @JsonCreator + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } + {{/jackson}} {{/withXml}} } diff --git a/templates/libraries/microprofile/enumOuterClass.mustache b/templates/libraries/microprofile/enumOuterClass.mustache index 894ce95..2539064 100644 --- a/templates/libraries/microprofile/enumOuterClass.mustache +++ b/templates/libraries/microprofile/enumOuterClass.mustache @@ -2,10 +2,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ +{{#jsonb}} +@JsonbTypeSerializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @@ -33,6 +40,22 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void serialize({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); + } + } + +{{/jsonb}} {{#jackson}} @JsonCreator {{/jackson}} @@ -44,5 +67,4 @@ import com.fasterxml.jackson.annotation.JsonValue; } {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} } - } diff --git a/templates/libraries/microprofile/formParamsNameSuffix.mustache b/templates/libraries/microprofile/formParamsNameSuffix.mustache new file mode 100644 index 0000000..a44f6d7 --- /dev/null +++ b/templates/libraries/microprofile/formParamsNameSuffix.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#isFile}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/templates/libraries/microprofile/generatedAnnotation.mustache b/templates/libraries/microprofile/generatedAnnotation.mustache index 875d7b9..cf058a0 100644 --- a/templates/libraries/microprofile/generatedAnnotation.mustache +++ b/templates/libraries/microprofile/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/templates/libraries/microprofile/kumuluzee.pom.mustache b/templates/libraries/microprofile/kumuluzee.pom.mustache index ac235b7..195aa9d 100644 --- a/templates/libraries/microprofile/kumuluzee.pom.mustache +++ b/templates/libraries/microprofile/kumuluzee.pom.mustache @@ -18,7 +18,7 @@ 1.2.3 1.4.1 3.2.6 - 4.13 + 5.10.2 2.28 @@ -70,8 +70,8 @@ ${cxf-rt-rs-extension-providers.version} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test diff --git a/templates/libraries/microprofile/model.mustache b/templates/libraries/microprofile/model.mustache index 5272ff0..e10e68d 100644 --- a/templates/libraries/microprofile/model.mustache +++ b/templates/libraries/microprofile/model.mustache @@ -6,9 +6,38 @@ package {{package}}; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{rootJavaEEPackage}}.xml.bind.annotation.*; +import {{rootJavaEEPackage}}.xml.bind.annotation.adapters.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; {{/useBeanValidation}} {{#models}} @@ -20,4 +49,4 @@ import javax.validation.Valid; {{>pojo}} {{/isEnum}} {{/model}} -{{/models}} +{{/models}} \ No newline at end of file diff --git a/templates/libraries/microprofile/pojo.mustache b/templates/libraries/microprofile/pojo.mustache index f2f269a..afad09a 100644 --- a/templates/libraries/microprofile/pojo.mustache +++ b/templates/libraries/microprofile/pojo.mustache @@ -1,57 +1,55 @@ {{#withXml}} -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -{{/withXml}} -{{^withXml}} -import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/withXml}} - -{{#withXml}} -@XmlAccessorType(XmlAccessType.FIELD) -{{#hasVars}} @XmlType(name = "{{classname}}", propOrder = - { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} -}){{/hasVars}} +{{#hasVars}}@XmlType(name = "{{classname}}", propOrder = + { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} } +){{/hasVars}} {{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}} -{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}} +{{> xmlAnnotation }} {{/withXml}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} +@JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} +{{/jackson}} {{#description}} /** * {{{.}}} - **/ + */ {{/description}} {{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} +{{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; +{{/jackson}} {{#withXml}} - @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#description}} /** - * {{{.}}} - **/ + * {{{.}}} + */ {{/description}} {{^withXml}} - @JsonbProperty("{{baseName}}") + {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}} {{/withXml}} +{{#vendorExtensions.x-field-extra-annotation}} +{{{vendorExtensions.x-field-extra-annotation}}} +{{/vendorExtensions.x-field-extra-annotation}} {{#isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} @@ -63,10 +61,10 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM public {{classname}}() { } - @JsonbCreator + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(value = JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { {{#readOnlyVars}} @@ -75,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM } {{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -92,14 +90,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{#deprecated}} * @deprecated {{/deprecated}} - **/ + **/ {{#deprecated}} @Deprecated {{/deprecated}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{dataType}} {{getter}}() { +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}} public {{dataType}} {{getter}}() { if ({{name}} == null) { return null; } @@ -116,10 +114,10 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{^isReadOnly}} /** - * Set {{name}} - **/ - {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} - {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + * Set {{name}} + */ +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } @@ -129,14 +127,20 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } this.{{name}}.put(key, {{name}}Item); return this; } @@ -146,14 +150,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{/vars}} /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class {{classname}} {\n"); {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} - {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{#vars}}sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}}sb.append("}"); return sb.toString(); } diff --git a/templates/libraries/microprofile/pom.mustache b/templates/libraries/microprofile/pom.mustache index 3d5f941..f814d4c 100644 --- a/templates/libraries/microprofile/pom.mustache +++ b/templates/libraries/microprofile/pom.mustache @@ -14,7 +14,7 @@ org.jboss.jandex jandex-maven-plugin - 1.1.0 + ${jandex.maven.plugin.version} make-index @@ -26,7 +26,7 @@ maven-failsafe-plugin - 2.6 + ${maven.failsafe.plugin.version} @@ -39,7 +39,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.9.1 + ${build.helper.maven.plugin.version} add-source @@ -58,10 +58,10 @@ - - junit - junit - ${junit-version} + + org.junit.jupiter + junit-jupiter-api + ${junit.version} test {{#useBeanValidation}} @@ -69,7 +69,7 @@ jakarta.validation jakarta.validation-api - ${beanvalidation-version} + ${beanvalidation.version} provided {{/useBeanValidation}} @@ -77,95 +77,125 @@ org.eclipse.microprofile.rest.client microprofile-rest-client-api - 1.4.1 + ${microprofile.rest.client.api.version} jakarta.ws.rs jakarta.ws.rs-api - ${jakarta.ws.rs-version} + ${jakarta.ws.rs.version} provided io.smallrye smallrye-rest-client - 1.2.1 + ${smallrye.rest.client.version} test io.smallrye smallrye-config - 1.3.5 + ${smallrye.config.version} test {{^disableMultipart}} org.apache.cxf cxf-rt-rs-extension-providers - 3.2.6 + ${cxf.rt.rs.extension.providers.version} {{/disableMultipart}} + {{#jsonb}} jakarta.json.bind jakarta.json.bind-api - ${jakarta.json.bind-version} + ${jakarta.json.bind.version} jakarta.json jakarta.json-api - ${jakarta.json-version} + ${jakarta.json.version} jakarta.xml.bind jakarta.xml.bind-api - ${jakarta.xml.bind-version} + ${jakarta.xml.bind.version} com.sun.xml.bind jaxb-core - 2.2.11 + ${jaxb.core.version} com.sun.xml.bind jaxb-impl - 2.2.11 + ${jaxb.impl.version} + + {{/jsonb}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + {{/withXml}} + {{/jackson}} jakarta.activation jakarta.activation-api - ${jakarta.activation-version} + ${jakarta.activation.version} - -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - ${jackson-jaxrs-version} + ${jackson.jaxrs.version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#useBeanValidationFeature}} org.hibernate hibernate-validator - 5.2.2.Final + ${hibernate.validator.version} {{/useBeanValidationFeature}} jakarta.annotation jakarta.annotation-api - ${jakarta-annotation-version} + ${jakarta.annotation.version} provided +{{#microprofileMutiny}} + + io.smallrye.reactive + mutiny + ${mutiny.version} + +{{/microprofileMutiny}} @@ -180,21 +210,37 @@ 1.8 ${java.version} ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.13.1 - 1.2.0 + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - 3.2.7 - 2.9.7 - 1.2.2 - 1.3.5 - 1.0.2 - 1.1.6 - 2.1.6 - 2.3.3 + 3.2.7 + 2.17.1 +{{#jackson}} + 2.17.1 +{{/jackson}} + 1.2.2 + 1.3.5 + 1.0.2 + 1.1.6 + 2.1.6 + 2.3.3 + {{microprofileRestClientVersion}} + 1.2.1 + 1.3.5 + 3.2.6 + 2.2.11 + 2.2.11 + 5.2.2.Final + 1.1.0 + 2.6 + 1.9.1 UTF-8 +{{#microprofileMutiny}} + 1.2.0 +{{/microprofileMutiny}} diff --git a/templates/libraries/microprofile/pom_3.0.mustache b/templates/libraries/microprofile/pom_3.0.mustache new file mode 100644 index 0000000..7accc4c --- /dev/null +++ b/templates/libraries/microprofile/pom_3.0.mustache @@ -0,0 +1,236 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{#appDescription}} + {{.}} + {{/appDescription}} + {{artifactVersion}} + + src/main/java + + + org.jboss.jandex + jandex-maven-plugin + ${jandex.maven.plugin.version} + + + make-index + + jandex + + + + + + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.maven.plugin.version} + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + +{{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation.version} + provided + +{{/useBeanValidation}} + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + provided + + + + org.glassfish.jersey.ext.microprofile + jersey-mp-rest-client + ${jersey.mp.rest.client.version} + test + + + org.apache.geronimo.config + geronimo-config-impl + ${geronimo.config.impl.version} + test + + + {{^disableMultipart}} + + org.apache.cxf + cxf-rt-rs-extension-providers + ${cxf.rt.rs.extension.providers.version} + + {{/disableMultipart}} + {{#jsonb}} + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + + {{/jsonb}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + {{/withXml}} + {{/jackson}} + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.jaxrs.version} + +{{#useBeanValidationFeature}} + + org.hibernate + hibernate-validator + ${hibernate.validator.version} + +{{/useBeanValidationFeature}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + provided + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 11 + ${java.version} + ${java.version} + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 +{{#useBeanValidation}} + 3.0.1 +{{/useBeanValidation}} + 3.2.7 + 2.17.1 +{{#jackson}} + 2.17.1 +{{/jackson}} + 2.1.0 + 2.0.0 + 2.0.0 + 2.0.1 + 3.0.0 + 3.0.1 + {{microprofileRestClientVersion}} + 3.0.4 + 1.2.3 + 3.5.1 + 3.0.2 + 3.0.2 + 7.0.4.Final + 1.1.0 + 2.6 + 1.9.1 + UTF-8 + + diff --git a/templates/libraries/microprofile/returnTypes.mustache b/templates/libraries/microprofile/returnTypes.mustache deleted file mode 100644 index 32f96a9..0000000 --- a/templates/libraries/microprofile/returnTypes.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: -}}{{^useGenericResponse}}{{! -}}{{{returnType}}}{{! -}}{{/useGenericResponse}} \ No newline at end of file diff --git a/templates/libraries/microprofile/server_operation.mustache b/templates/libraries/microprofile/server_operation.mustache new file mode 100644 index 0000000..d6fa905 --- /dev/null +++ b/templates/libraries/microprofile/server_operation.mustache @@ -0,0 +1 @@ +{{#vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}Response{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}}{{^vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}} \ No newline at end of file diff --git a/templates/libraries/native/AbstractOpenApiSchema.mustache b/templates/libraries/native/AbstractOpenApiSchema.mustache index 19bf0a6..f196a13 100644 --- a/templates/libraries/native/AbstractOpenApiSchema.mustache +++ b/templates/libraries/native/AbstractOpenApiSchema.mustache @@ -2,7 +2,6 @@ package {{modelPackage}}; -import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; @@ -12,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/templates/libraries/native/ApiClient.mustache b/templates/libraries/native/ApiClient.mustache index 03fe2a4..a641525 100644 --- a/templates/libraries/native/ApiClient.mustache +++ b/templates/libraries/native/ApiClient.mustache @@ -14,13 +14,12 @@ import java.io.InputStream; import java.net.URI; import java.net.URLEncoder; import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -{{#java8}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Collection; import java.util.Collections; import java.util.List; @@ -56,16 +55,15 @@ public class ApiClient { private Consumer> responseInterceptor; private Consumer> asyncResponseInterceptor; private Duration readTimeout; + private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } - {{#java8}} if (value instanceof OffsetDateTime) { return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); } - {{/java8}} return value.toString(); } @@ -154,7 +152,7 @@ public class ApiClient { } /** - * Ctor. + * Create an instance of ApiClient. */ public ApiClient() { this.builder = createDefaultHttpClientBuilder(); @@ -162,12 +160,17 @@ public class ApiClient { updateBaseUri(getDefaultBaseUri()); interceptor = null; readTimeout = null; + connectTimeout = null; responseInterceptor = null; asyncResponseInterceptor = null; } /** - * Ctor. + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI */ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; @@ -175,6 +178,7 @@ public class ApiClient { updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); interceptor = null; readTimeout = null; + connectTimeout = null; responseInterceptor = null; asyncResponseInterceptor = null; } @@ -411,4 +415,35 @@ public class ApiClient { public Duration getReadTimeout() { return readTimeout; } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } } diff --git a/templates/libraries/native/ApiResponse.mustache b/templates/libraries/native/ApiResponse.mustache index 1e27731..e2f8f6c 100644 --- a/templates/libraries/native/ApiResponse.mustache +++ b/templates/libraries/native/ApiResponse.mustache @@ -14,6 +14,7 @@ import java.util.TreeMap; * * @param The type of data that is deserialized from response body */ +{{>generatedAnnotation}} public class ApiResponse { final private int statusCode; final private Map> headers; diff --git a/templates/libraries/native/JSON.mustache b/templates/libraries/native/JSON.mustache index 961f23b..813bb79 100644 --- a/templates/libraries/native/JSON.mustache +++ b/templates/libraries/native/JSON.mustache @@ -1,22 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -32,28 +27,20 @@ public class JSON { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} - mapper.registerModule(new JavaTimeModule()); - {{/java8}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -62,6 +49,7 @@ public class JSON { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -81,6 +69,8 @@ public class JSON { * * @param node The input data. * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. */ public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); @@ -93,6 +83,7 @@ public class JSON { /** * Helper class to register the discriminator mappings. */ + {{>generatedAnnotation}} private static class ClassDiscriminatorMapping { // The model class name. Class modelClass; @@ -140,6 +131,8 @@ public class JSON { * * @param node The input data. * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. */ Class getClassForElement(JsonNode node, Set> visitedClasses) { if (visitedClasses.contains(modelClass)) { @@ -186,6 +179,9 @@ public class JSON { * * @param modelClass A OpenAPI model class. * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { diff --git a/templates/libraries/native/README.mustache b/templates/libraries/native/README.mustache index ef15f37..fd7d490 100644 --- a/templates/libraries/native/README.mustache +++ b/templates/libraries/native/README.mustache @@ -8,6 +8,8 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} + {{{appDescriptionWithNewLines}}} {{#infoUrl}} @@ -139,11 +141,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -151,10 +156,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth diff --git a/templates/libraries/native/additional_properties.mustache b/templates/libraries/native/additional_properties.mustache index 61973dc..8e71827 100644 --- a/templates/libraries/native/additional_properties.mustache +++ b/templates/libraries/native/additional_properties.mustache @@ -9,6 +9,9 @@ /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference */ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { @@ -20,7 +23,8 @@ } /** - * Return the additional (undeclared) property. + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties */ @JsonAnyGetter public Map getAdditionalProperties() { @@ -29,6 +33,8 @@ /** * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name */ public {{{.}}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { diff --git a/templates/libraries/native/anyof_model.mustache b/templates/libraries/native/anyof_model.mustache index c87c932..dfb6464 100644 --- a/templates/libraries/native/anyof_model.mustache +++ b/templates/libraries/native/anyof_model.mustache @@ -21,7 +21,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -54,7 +54,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -195,4 +195,168 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} + +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (getActualInstance() instanceof {{{dataType}}}) { + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getActualInstance().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if ((({{{dataType}}})getActualInstance()).get(i) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if (getActualInstance().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getActualInstance().get(_key), URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + if ((({{{dataType}}})getActualInstance()).get(_key) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if (getActualInstance() != null) { + joiner.add((({{{dataType}}})getActualInstance()).toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + return joiner.toString(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + return null; + } +{{/supportUrlQuery}} + } diff --git a/templates/libraries/native/api.mustache b/templates/libraries/native/api.mustache index 86fb8dd..a80dcba 100644 --- a/templates/libraries/native/api.mustache +++ b/templates/libraries/native/api.mustache @@ -13,22 +13,40 @@ import {{import}}; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import java.io.IOException; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} +{{#hasFormParamsInSpec}} +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +{{/hasFormParamsInSpec}} import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -import java.util.function.Consumer; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.StringJoiner; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} +import java.util.function.Consumer; {{#asyncNative}} import java.util.concurrent.CompletableFuture; @@ -91,6 +109,11 @@ public class {{classname}} { {{#returnType}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} + {{^returnType}} + {{#asyncNative}} + * @return CompletableFuture<Void> + {{/asyncNative}} + {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -140,11 +163,16 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} + {{^returnType}} + {{#asyncNative}} + * @return CompletableFuture<Void> + {{/asyncNative}} + {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -175,8 +203,9 @@ public class {{classname}} { } {{#returnType}} try { + String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) + responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {}) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); @@ -197,7 +226,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call @@ -226,12 +255,33 @@ public class {{classname}} { if (localVarResponse.statusCode()/ 100 != 2) { throw getApiException("{{operationId}}", localVarResponse); } + {{#vendorExtensions.x-java-text-plain-string}} + // for plain text response + if (localVarResponse.headers().map().containsKey("Content-Type") && + "text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0).split(";")[0].trim())) { + java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A"); + String responseBodyText = s.hasNext() ? s.next() : ""; + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBodyText + ); + } else { + throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse); + } + {{/vendorExtensions.x-java-text-plain-string}} + {{^vendorExtensions.x-java-text-plain-string}} return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream{{/returnType}} - {{^returnType}}null{{/returnType}} + {{#returnType}} + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream + {{/returnType}} + {{^returnType}} + null + {{/returnType}} ); + {{/vendorExtensions.x-java-text-plain-string}} } finally { {{^returnType}} // Drain the InputStream @@ -263,11 +313,12 @@ public class {{classname}} { } {{#returnType}} try { + String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( new ApiResponse<{{{returnType}}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})) + responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {})) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); @@ -304,28 +355,64 @@ public class {{classname}} { .replace({{=<% %>=}}"{<%baseName%>}"<%={{ }}=%>, ApiClient.urlEncode({{{paramName}}}.toString())){{/pathParams}}; {{#hasQueryParams}} - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList<>(); + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; {{#queryParams}} + localVarQueryParameterBaseName = "{{{baseName}}}"; {{#collectionFormat}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/collectionFormat}} {{^collectionFormat}} {{#isDeepObject}} if ({{paramName}} != null) { - {{#items.vars}} - localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); - {{/items.vars}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + String queryString = {{paramName}}.toUrlQueryString("{{baseName}}"); + if (!queryString.isBlank()) { + localVarQueryStringJoiner.add(queryString); + } + {{/isArray}} } {{/isDeepObject}} {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isExplode}} {{/isDeepObject}} {{/collectionFormat}} {{/queryParams}} - if (!localVarQueryParams.isEmpty()) { - {{javaUtilPrefix}}StringJoiner queryJoiner = new StringJoiner("&"); + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); } else { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); @@ -341,20 +428,113 @@ public class {{classname}} { } {{/headerParams}} {{#bodyParam}} - localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{mediaType}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); + localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); {{/bodyParam}} - localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); + localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); {{#bodyParam}} + {{#isString}} + localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofString({{paramName}})); + {{/isString}} + {{^isString}} try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes({{paramName}}); localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); } + {{/isString}} {{/bodyParam}} {{^bodyParam}} + {{#hasFormParams}} + {{#isMultipart}} + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + {{#formParams}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + {{#isFile}} + multiPartBuilder.addBinaryBody("{{{baseName}}}", {{paramName}}.get(i)); + hasFiles = true; + {{/isFile}} + {{^isFile}} + multiPartBuilder.addTextBody("{{{baseName}}}", {{paramName}}.get(i).toString()); + {{/isFile}} + } + {{/isArray}} + {{^isArray}} + {{#isFile}} + multiPartBuilder.addBinaryBody("{{{baseName}}}", {{paramName}}); + hasFiles = true; + {{/isFile}} + {{^isFile}} + multiPartBuilder.addTextBody("{{{baseName}}}", {{paramName}}.toString()); + {{/isFile}} + {{/isArray}} + {{/formParams}} + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("{{httpMethod}}", formDataPublisher); + {{/isMultipart}} + {{^isMultipart}} + List formValues = new ArrayList<>(); + {{#formParams}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + if ({{paramName}}.get(i) != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.get(i).toString())); + } + } + {{/isArray}} + {{^isArray}} + if ({{paramName}} != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.toString())); + } + {{/isArray}} + {{/formParams}} + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("{{httpMethod}}", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + {{/isMultipart}} + {{/hasFormParams}} + {{^hasFormParams}} localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.noBody()); + {{/hasFormParams}} {{/bodyParam}} if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); @@ -364,6 +544,7 @@ public class {{classname}} { } return localVarRequestBuilder; } + {{#vendorExtensions.x-group-parameters}} {{#hasParams}} @@ -372,7 +553,7 @@ public class {{classname}} { private {{{dataType}}} {{paramName}}; // {{description}} (required) {{/requiredParams}} {{#optionalParams}} - private {{{dataType}}} {{paramName}}; // {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}} + private {{{dataType}}} {{paramName}}; // {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) {{/optionalParams}} private API{{operationId}}Request(Builder builder) { diff --git a/templates/libraries/native/apiException.mustache b/templates/libraries/native/apiException.mustache index 3d0eee4..9596b73 100644 --- a/templates/libraries/native/apiException.mustache +++ b/templates/libraries/native/apiException.mustache @@ -6,6 +6,8 @@ import java.net.http.HttpHeaders; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private HttpHeaders responseHeaders = null; private String responseBody = null; diff --git a/templates/libraries/native/api_doc.mustache b/templates/libraries/native/api_doc.mustache index 3af38b3..2b125e1 100644 --- a/templates/libraries/native/api_doc.mustache +++ b/templates/libraries/native/api_doc.mustache @@ -4,10 +4,10 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +| [**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -98,9 +98,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -230,9 +230,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -266,13 +266,13 @@ Name | Type | Description | Notes {{/responses.0}} {{#vendorExtensions.x-group-parameters}}{{#hasParams}} - + ## API{{operationId}}Request ### Properties {{#allParams}}{{#-last}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/hasParams}}{{/vendorExtensions.x-group-parameters}} diff --git a/templates/libraries/native/api_test.mustache b/templates/libraries/native/api_test.mustache index ffcf05e..497bd53 100644 --- a/templates/libraries/native/api_test.mustache +++ b/templates/libraries/native/api_test.mustache @@ -5,25 +5,28 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} {{#asyncNative}} import java.util.concurrent.CompletableFuture; {{/asyncNative}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/templates/libraries/native/build.gradle.mustache b/templates/libraries/native/build.gradle.mustache index 03d303d..24ea4fe 100644 --- a/templates/libraries/native/build.gradle.mustache +++ b/templates/libraries/native/build.gradle.mustache @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = '{{groupId}}' version = '{{artifactVersion}}' @@ -8,6 +9,9 @@ buildscript { repositories { mavenCentral() } + dependencies { + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } } repositories { @@ -62,17 +66,27 @@ artifacts { ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.4" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.1" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.10.2" + {{#hasFormParamsInSpec}} + httpmime_version = "4.5.13" + {{/hasFormParamsInSpec}} } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" @@ -80,8 +94,31 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - testImplementation "junit:junit:$junit_version" + {{#hasFormParamsInSpec}} + implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + {{/hasFormParamsInSpec}} + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } } diff --git a/templates/libraries/native/generatedAnnotation.mustache b/templates/libraries/native/generatedAnnotation.mustache index baf5ff0..e05689d 100644 --- a/templates/libraries/native/generatedAnnotation.mustache +++ b/templates/libraries/native/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.processing.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/templates/libraries/native/model.mustache b/templates/libraries/native/model.mustache index 6f2436c..cd2a85a 100644 --- a/templates/libraries/native/model.mustache +++ b/templates/libraries/native/model.mustache @@ -16,8 +16,12 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/additionalPropertiesType}} {{/model}} {{/models}} +{{#supportUrlQuery}} +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +{{/supportUrlQuery}} import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; {{#imports}} @@ -36,15 +40,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; {{/withXml}} {{#parcelableModel}} import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/templates/libraries/native/modelEnum.mustache b/templates/libraries/native/modelEnum.mustache new file mode 100644 index 0000000..5f22f75 --- /dev/null +++ b/templates/libraries/native/modelEnum.mustache @@ -0,0 +1,120 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} +{{#gson}} +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +{{/gson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{#gson}} +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +{{/gson}} +{{#jsonb}} +@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + +{{#jackson}} + @JsonValue +{{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} + +{{#gson}} + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } +{{/gson}} +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} +} diff --git a/templates/libraries/native/oneof_model.mustache b/templates/libraries/native/oneof_model.mustache index 993961a..8aa2ef0 100644 --- a/templates/libraries/native/oneof_model.mustache +++ b/templates/libraries/native/oneof_model.mustache @@ -23,7 +23,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,12 +60,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { - {{#mappedModels}} + {{#mappedModels}} case "{{{mappingName}}}": deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; - {{/mappedModels}} + {{/mappedModels}} default: log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); } @@ -228,4 +228,168 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} + +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (getActualInstance() instanceof {{{dataType}}}) { + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getActualInstance().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if ((({{{dataType}}})getActualInstance()).get(i) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if (getActualInstance().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getActualInstance().get(_key), URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + if ((({{{dataType}}})getActualInstance()).get(_key) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if (getActualInstance() != null) { + joiner.add((({{{dataType}}})getActualInstance()).toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + return joiner.toString(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + return null; + } +{{/supportUrlQuery}} + } diff --git a/templates/libraries/native/pojo.mustache b/templates/libraries/native/pojo.mustache index 5f0c036..1250a71 100644 --- a/templates/libraries/native/pojo.mustache +++ b/templates/libraries/native/pojo.mustache @@ -1,12 +1,24 @@ {{#discriminator}} import {{invokerPackage}}.JSON; {{/discriminator}} +{{#supportUrlQuery}} +import {{invokerPackage}}.ApiClient; +{{/supportUrlQuery}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -15,6 +27,9 @@ import {{invokerPackage}}.JSON; }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -40,29 +55,17 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); @@ -72,12 +75,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -94,7 +92,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} @@ -123,10 +121,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -136,11 +134,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -148,10 +144,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -161,11 +157,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -173,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -190,22 +184,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -213,8 +215,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore {{/vendorExtensions.x-is-jackson-optional-nullable}} -{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} - public {{{datatypeWithEnum}}} {{getter}}() { +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() { {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) { @@ -261,6 +262,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vars}} {{>libraries/native/additional_properties}} + {{#parent}} + {{#allVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + + {{/isOverridden}} + {{/allVars}} + {{/parent}} /** * Return true if this {{name}} object is equal to o. */ @@ -314,7 +332,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -333,7 +351,165 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(ApiClient.valueToString({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -404,4 +580,8 @@ static { JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); } {{/discriminator}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} } diff --git a/templates/libraries/native/pom.mustache b/templates/libraries/native/pom.mustache index c0c151c..8ed8277 100644 --- a/templates/libraries/native/pom.mustache +++ b/templates/libraries/native/pom.mustache @@ -42,7 +42,7 @@ maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -64,7 +64,7 @@ maven-surefire-plugin - 3.0.0-M3 + 3.2.5 conf/log4j.properties @@ -76,7 +76,7 @@ maven-dependency-plugin - 3.1.1 + 3.3.0 package @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.1.2 + 3.3.0 @@ -107,12 +107,12 @@ maven-compiler-plugin - 3.8.1 + 3.10.1 org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.4.1 attach-javadocs @@ -124,7 +124,7 @@ maven-source-plugin - 3.1.0 + 3.2.1 attach-sources @@ -134,6 +134,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -144,7 +184,7 @@ maven-gpg-plugin - 1.6 + 3.0.1 sign-artifacts @@ -161,11 +201,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -193,13 +242,6 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} @@ -213,11 +255,27 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#hasFormParamsInSpec}} + + org.apache.httpcomponents + httpmime + ${httpmime-version} + + {{/hasFormParamsInSpec}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -225,15 +283,29 @@ UTF-8 - 1.5.22 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} 11 11 - 2.10.4 - 0.2.2 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#hasFormParamsInSpec}} + 4.5.14 + {{/hasFormParamsInSpec}} + 5.10.2 + 2.27.2 diff --git a/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache b/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache deleted file mode 100644 index 53b6a7b..0000000 --- a/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache b/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache deleted file mode 100644 index de8ac25..0000000 --- a/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache +++ /dev/null @@ -1,1738 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -{{#dynamicOperations}} -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum; -import io.swagger.v3.parser.OpenAPIV3Parser; -{{/dynamicOperations}} -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; -{{#joda}} -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -{{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.common.message.types.GrantType; -{{/hasOAuthMethods}} - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -{{#java8}} -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -{{/java8}} -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import {{invokerPackage}}.auth.Authentication; -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.RetryingOAuth; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -/** - *

ApiClient class.

- */ -public class ApiClient { - - private String basePath = "{{{basePath}}}"; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - {{#dynamicOperations}} - private Map operationLookupMap = new HashMap<>(); - - {{/dynamicOperations}} - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{#hasOAuthMethods}} - {{#oauthMethods}} - {{#-first}} - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID - * - * @param clientId client ID - */ - public ApiClient(String clientId) { - this(clientId, null, null); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters - * - * @param clientId client ID - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, Map parameters) { - this(clientId, null, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters - * - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, String clientSecret, Map parameters) { - this(null, clientId, clientSecret, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters - * - * @param basePath base path - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { - init(); - if (basePath != null) { - this.basePath = basePath; - } - -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; - if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { - URI uri = URI.create(getBasePath()); - tokenUrl = uri.getScheme() + ":" + - (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + - tokenUrl; - if (!URI.create(tokenUrl).isAbsolute()) { - throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); - } - } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); - authentications.put( - "{{name}}", - retryingOAuth - ); - initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} - - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{/-first}} - {{/oauthMethods}} - {{/hasOAuthMethods}} - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - {{#useGzipFeature}} - // Enable gzip request compression - builder.addInterceptor(new GzipRequestInterceptor()); - {{/useGzipFeature}} - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); - - authentications = new HashMap(); - {{#dynamicOperations}} - - OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml"); - createOperationLookupMap(openAPI); - {{/dynamicOperations}} - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g {{{basePath}}} - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

Getter for the field keyManagers.

- * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

Getter for the field dateFormat.

- * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

Setter for the field dateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - /** - *

Set SqlDateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - - {{#joda}} - public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); - return this; - } - - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/joda}} - {{#jsr310}} - /** - *

Set OffsetDateTimeFormat.

- * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

Set LocalDateFormat.

- * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/jsr310}} - /** - *

Set LenientOnJson.

- * - * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - {{/hasHttpBearerMethods}} - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - {{#hasOAuthMethods}} - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - {{/hasOAuthMethods}} - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for (Authentication apiAuth : authentications.values()) { - if (apiAuth instanceof RetryingOAuth) { - RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; - return retryingOAuth.getTokenRequestBuilder(); - } - } - return null; - } - {{/hasOAuthMethods}} - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - {{^dynamicOperations}} - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - {{#dynamicOperations}} - public List parameterToPairs(Parameter param, Collection value) { - List params = new ArrayList(); - - // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { - return params; - } - - // create the params based on the collection format - if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) { - for (Object item : value) { - params.add(new Pair(param.getName(), escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString(" "); - } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(param.getName(), sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = json.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{#supportStreaming}} - /** - *

Execute stream.

- * - * @param call a {@link okhttp3.Call} object - * @param returnType a {@link java.lang.reflect.Type} object - * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. - */ - public InputStream executeStream(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); - } - if (response.body() == null) { - return null; - } - return response.body().byteStream(); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{/supportStreaming}} - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws org.openapitools.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - {{#dynamicOperations}} - - public ApiClient createOperationLookupMap(OpenAPI openAPI) { - operationLookupMap = new HashMap<>(); - for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) { - String path = pathItemEntry.getKey(); - PathItem pathItem = pathItemEntry.getValue(); - addOperationLookupEntry(path, "GET", pathItem.getGet()); - addOperationLookupEntry(path, "PUT", pathItem.getPut()); - addOperationLookupEntry(path, "POST", pathItem.getPost()); - addOperationLookupEntry(path, "DELETE", pathItem.getDelete()); - addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions()); - addOperationLookupEntry(path, "HEAD", pathItem.getHead()); - addOperationLookupEntry(path, "PATCH", pathItem.getPatch()); - addOperationLookupEntry(path, "TRACE", pathItem.getTrace()); - } - return this; - } - - private void addOperationLookupEntry(String path, String method, Operation operation) { - if ( operation != null && operation.getOperationId() != null) { - operationLookupMap.put( - operation.getOperationId(), - new ApiOperation(path, method, operation)); - } - } - - public Map getOperationLookupMap() { - return operationLookupMap; - } - - public String fillParametersFromOperation( - Operation operation, - Map paramMap, - String path, - List queryParams, - List collectionQueryParams, - Map headerParams, - Map cookieParams - ) { - for (Map.Entry entry : paramMap.entrySet()) { - Object value = entry.getValue(); - for (Parameter param : operation.getParameters()) { - if (entry.getKey().equals(param.getName())) { - switch (param.getIn()) { - case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); - break; - case "query": - if (value instanceof Collection) { - collectionQueryParams.addAll(parameterToPairs(param, (Collection) value)); - } else { - queryParams.addAll(parameterToPair(param.getName(), value)); - } - break; - case "header": - headerParams.put(param.getName(), parameterToString(value)); - break; - case "cookie": - cookieParams.put(param.getName(), parameterToString(value)); - break; - default: - throw new IllegalStateException("Unexpected param in: " + param.getIn()); - } - - } - } - } - return path; - } - {{/dynamicOperations}} - - /** - * Convert the HTTP request body to a string. - * - * @param request The HTTP request object - * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache b/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache deleted file mode 100644 index cecbaac..0000000 --- a/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache +++ /dev/null @@ -1,75 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.List; -import java.util.Map; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - {{#caseInsensitiveResponseHeaders}} - Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : headers.entrySet()){ - responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; - this.data = data; - } - - /** - *

Get the status code.

- * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

Get the headers.

- * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

Get the data.

- * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache b/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache deleted file mode 100644 index b633aa8..0000000 --- a/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache b/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache deleted file mode 100644 index 71e1e2b..0000000 --- a/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache +++ /dev/null @@ -1,62 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache b/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache deleted file mode 100644 index 4511594..0000000 --- a/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache +++ /dev/null @@ -1,59 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/README.mustache b/templates/libraries/okhttp-gson-nextgen/README.mustache deleted file mode 100644 index a1a142b..0000000 --- a/templates/libraries/okhttp-gson-nextgen/README.mustache +++ /dev/null @@ -1,183 +0,0 @@ -# {{artifactId}} - -{{appName}} -- API version: {{appVersion}} -{{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} - -{{{appDescriptionWithNewLines}}} - -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - - -## Requirements - -Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ -2. Maven (3.8.3+)/Gradle (7.2+) - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy - repositories { - mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. - mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. - } - - dependencies { - implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" - } -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -{{/-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#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation for Models - -{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) -{{/model}}{{/models}} - -## Documentation for Authorization - -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache b/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache deleted file mode 100644 index fae56fd..0000000 --- a/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ /dev/null @@ -1,236 +0,0 @@ -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import {{invokerPackage}}.JSON; - -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { - private static final Logger log = Logger.getLogger({{classname}}.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - {{#anyOf}} - final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); - {{/anyOf}} - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - {{#anyOf}} - // check if the actual instance is of the type `{{.}}` - if (value.getActualInstance() instanceof {{.}}) { - JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - {{/anyOf}} - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - // use discriminator value for faster anyOf lookup - {{classname}} new{{classname}} = new {{classname}}(); - String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{{mappingName}}}": - deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); - new{{classname}}.setActualInstance(deserialized); - return new{{classname}}; - {{/mappedModels}} - default: - log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - {{#anyOf}} - // deserialize {{{.}}} - try { - // validate the JSON object to see if any excpetion is thrown - {{.}}.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); - {{classname}} ret = new {{classname}}(); - ret.setActualInstance(adapter{{.}}.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); - } - - {{/anyOf}} - - throw new IOException(String.format("Failed deserialization for {{classname}}: no class matched. JSON: %s", jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); - - public {{classname}}() { - super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - } - - {{#anyOf}} - public {{classname}}({{{.}}} o) { - super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - setActualInstance(o); - } - - {{/anyOf}} - static { - {{#anyOf}} - schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { - }); - {{/anyOf}} - } - - @Override - public Map getSchemas() { - return {{classname}}.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} - * - * It could be an instance of the 'anyOf' schemas. - * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). - */ - @Override - public void setActualInstance(Object instance) { - {{#isNullable}} - if (instance == null) { - super.setActualInstance(instance); - return; - } - - {{/isNullable}} - {{#anyOf}} - if (instance instanceof {{{.}}}) { - super.setActualInstance(instance); - return; - } - - {{/anyOf}} - throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); - } - - /** - * Get the actual instance, which can be the following: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} - * - * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - {{#anyOf}} - /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` - */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); - } - - {{/anyOf}} - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate anyOf schemas one by one - int validCount = 0; - {{#anyOf}} - // validate the json string with {{{.}}} - try { - {{{.}}}.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - {{/anyOf}} - if (validCount == 0) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObj.toString())); - } - } - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/api.mustache b/templates/libraries/okhttp-gson-nextgen/api.mustache deleted file mode 100644 index 943e694..0000000 --- a/templates/libraries/okhttp-gson-nextgen/api.mustache +++ /dev/null @@ -1,520 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiCallback; -import {{invokerPackage}}.ApiClient; -import {{invokerPackage}}.ApiException; -{{#dynamicOperations}} -import {{invokerPackage}}.ApiOperation; -{{/dynamicOperations}} -import {{invokerPackage}}.ApiResponse; -import {{invokerPackage}}.Configuration; -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ProgressRequestBody; -import {{invokerPackage}}.ProgressResponseBody; -{{#performBeanValidation}} -import {{invokerPackage}}.BeanValidationException; -{{/performBeanValidation}} - -import com.google.gson.reflect.TypeToken; -{{#dynamicOperations}} -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.parameters.Parameter; -{{/dynamicOperations}} - -import java.io.IOException; - -{{#useBeanValidation}} -import javax.validation.constraints.*; -{{/useBeanValidation}} -{{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; -import java.util.Set; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -{{/performBeanValidation}} - -{{#imports}}import {{import}}; -{{/imports}} - -import java.lang.reflect.Type; -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} -import javax.ws.rs.core.GenericType; - -{{#operations}} -public class {{classname}} { - private ApiClient localVarApiClient; - - public {{classname}}() { - this(Configuration.getDefaultApiClient()); - } - - public {{classname}}(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - {{#operation}} - {{^vendorExtensions.x-group-parameters}}/** - * Build call for {{operationId}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - - // create path and map variables - {{^dynamicOperations}} - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; - {{/dynamicOperations}} - {{#dynamicOperations}} - ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); - if (apiOperation == null) { - throw new ApiException("Operation not found in OAS"); - } - Operation operation = apiOperation.getOperation(); - String localVarPath = apiOperation.getPath(); - Map paramMap = new HashMap<>(); - {{#allParams}} - {{^isFormParam}} - {{^isBodyParam}} - paramMap.put("{{baseName}}", {{paramName}}); - {{/isBodyParam}} - {{/isFormParam}} - {{/allParams}} - {{/dynamicOperations}} - - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); - - {{#formParams}} - if ({{paramName}} != null) { - localVarFormParams.put("{{baseName}}", {{paramName}}); - } - - {{/formParams}} - {{^dynamicOperations}} - {{#queryParams}} - if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); - } - - {{/queryParams}} - {{#headerParams}} - if ({{paramName}} != null) { - localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/headerParams}} - {{#cookieParams}} - if ({{paramName}} != null) { - localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/cookieParams}} - {{/dynamicOperations}} - {{#dynamicOperations}} - localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); - - {{/dynamicOperations}} - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - @SuppressWarnings("rawtypes") - private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - {{^performBeanValidation}} - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) { - throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); - } - {{/required}}{{/allParams}} - - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - {{/performBeanValidation}} - {{#performBeanValidation}} - try { - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - ExecutableValidator executableValidator = factory.getValidator().forExecutables(); - - Object[] parameterValues = { {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }; - Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isArray}}java.util.List{{/isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isArray}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class{{/allParams}}); - Set> violations = executableValidator.validateParameters(this, method, - parameterValues); - - if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - } else { - throw new BeanValidationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - - {{/performBeanValidation}} - } - - {{^vendorExtensions.x-group-parameters}} - /** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#vendorExtensions.x-streaming}} - public {{#returnType}}InputStream {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}InputStream localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp;{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{/vendorExtensions.x-group-parameters}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{^returnType}} - return localVarApiClient.execute(localVarCall); - {{/returnType}} - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} (asynchronously) - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);{{/returnType}}{{^returnType}}localVarApiClient.executeAsync(localVarCall, _callback);{{/returnType}} - return localVarCall; - } - {{#vendorExtensions.x-group-parameters}} - - public class API{{operationId}}Request { - {{#requiredParams}} - private final {{{dataType}}} {{paramName}}; - {{/requiredParams}} - {{#optionalParams}} - private {{{dataType}}} {{paramName}}; - {{/optionalParams}} - - private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - {{#requiredParams}} - this.{{paramName}} = {{paramName}}; - {{/requiredParams}} - } - - {{#optionalParams}} - /** - * Set {{paramName}} - * @param {{paramName}} {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) - * @return API{{operationId}}Request - */ - public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { - this.{{paramName}} = {{paramName}}; - return this; - } - - {{/optionalParams}} - /** - * Build call for {{operationId}} - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - - /** - * Execute {{operationId}} request{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - - /** - * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { - return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - } - - /** - * Execute {{operationId}} request (asynchronously) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - } - - /** - * {{summary}} - * {{notes}}{{#requiredParams}} - * @param {{paramName}} {{description}} (required){{/requiredParams}} - * @return API{{operationId}}Request - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}); - } - {{/vendorExtensions.x-group-parameters}} - {{/operation}} -} -{{/operations}} diff --git a/templates/libraries/okhttp-gson-nextgen/apiException.mustache b/templates/libraries/okhttp-gson-nextgen/apiException.mustache deleted file mode 100644 index 59da3c5..0000000 --- a/templates/libraries/okhttp-gson-nextgen/apiException.mustache +++ /dev/null @@ -1,199 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.Map; -import java.util.List; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -import javax.ws.rs.core.GenericType; - -/** - *

ApiException class.

- */ -@SuppressWarnings("serial") -{{>generatedAnnotation}} -public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; - private GenericType errorObjectType = null; - - /** - *

Constructor for ApiException.

- */ - public ApiException() {} - - /** - *

Constructor for ApiException.

- * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the error object type. - * - * @return Error object type - */ - public GenericType getErrorObjectType() { - return errorObjectType; - } - - /** - * Set the error object type. - * - * @param errorObjectType object type - */ - public void setErrorObjectType(GenericType errorObjectType) { - this.errorObjectType = errorObjectType; - } - - /** - * Get the error object. - * - * @return Error object - */ - public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { - return errorObject; - } - - /** - * Get the error object. - * - * @param errorObject Error object - */ - public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { - this.errorObject = errorObject; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/api_doc.mustache b/templates/libraries/okhttp-gson-nextgen/api_doc.mustache deleted file mode 100644 index 616ad65..0000000 --- a/templates/libraries/okhttp-gson-nextgen/api_doc.mustache +++ /dev/null @@ -1,118 +0,0 @@ -# {{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} - -# **{{operationId}}**{{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} - -{{summary}}{{#notes}} - -{{.}}{{/notes}} - -### Example -```java -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - {{=< >=}} - <#errorObjectSubtype> - <^-first>} else if (e.getErrorObject() instanceof <&.>) { - // do something here - <#-last> - } else { - // something else happened - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - - <={{ }}=> - - } - } -} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -{{/operation}} -{{/operations}} diff --git a/templates/libraries/okhttp-gson-nextgen/api_test.mustache b/templates/libraries/okhttp-gson-nextgen/api_test.mustache deleted file mode 100644 index 98a30a6..0000000 --- a/templates/libraries/okhttp-gson-nextgen/api_test.mustache +++ /dev/null @@ -1,56 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiException; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Test; -import org.junit.Ignore; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -@Ignore -public class {{classname}}Test { - - private final {{classname}} api = new {{classname}}(); - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void {{operationId}}Test() throws ApiException { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache b/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache deleted file mode 100644 index a0dda66..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,69 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache b/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache deleted file mode 100644 index c4ad338..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache +++ /dev/null @@ -1,25 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache b/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache deleted file mode 100644 index 417a89e..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,46 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache b/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache deleted file mode 100644 index c8a9fce..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,52 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache b/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache deleted file mode 100644 index 34d3598..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache +++ /dev/null @@ -1,31 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache b/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index cb0e825..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,70 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import okhttp3.OkHttpClient; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -public class OAuthOkHttpClient implements HttpClient { - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - @Override - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - @Override - public void shutdown() { - // Nothing to do here - } -} -{{/hasOAuthMethods}} diff --git a/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache b/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache deleted file mode 100644 index 43d58ce..0000000 --- a/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache +++ /dev/null @@ -1,213 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class RetryingOAuth extends OAuth implements Interceptor { - private OAuthClient oAuthClient; - - private TokenRequestBuilder tokenRequestBuilder; - - /** - * @param client An OkHttp client - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { - this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = tokenRequestBuilder; - } - - /** - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { - this(new OkHttpClient(), tokenRequestBuilder); - } - - /** - * @param tokenUrl The token URL to be used for this OAuth2 flow. - * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - * The value must be an absolute URL. - * @param clientId The OAuth2 client ID for the "clientCredentials" flow. - * @param flow OAuth flow. - * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - * @param parameters A map of string. - */ - public RetryingOAuth( - String tokenUrl, - String clientId, - OAuthFlow flow, - String clientSecret, - Map parameters - ) { - this(OAuthClientRequest.tokenLocation(tokenUrl) - .setClientId(clientId) - .setClientSecret(clientSecret)); - setFlow(flow); - if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); - } - } - } - - /** - * Set the OAuth flow - * - * @param flow The OAuth flow. - */ - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case implicit: - tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) throws IOException { - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already has an authorization (e.g. Basic auth), proceed with the request as is - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // Get the token if it has not yet been acquired - if (getAccessToken() == null) { - updateAccessToken(null); - } - - OAuthClientRequest oAuthRequest; - if (getAccessToken() != null) { - // Build the request - Request.Builder requestBuilder = request.newBuilder(); - - String requestAccessToken = getAccessToken(); - try { - oAuthRequest = - new OAuthBearerClientRequest(request.url().toString()). - setAccessToken(requestAccessToken). - buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); - } - requestBuilder.url(oAuthRequest.getLocationUri()); - - // Execute the request - Response response = chain.proceed(requestBuilder.build()); - - // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row - if ( - response != null && - ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || - response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && - updateTokenAndRetryOnAuthorizationFailure - ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept(chain, false); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } - else { - return chain.proceed(chain.request()); - } - } - - /** - * Returns true if the access token has been updated - * - * @param requestAccessToken the request access token - * @return True if the update is successful - * @throws java.io.IOException If fail to update the access token - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = - oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - } - } catch (OAuthSystemException | OAuthProblemException e) { - throw new IOException(e); - } - } - return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); - } - - /** - * Gets the token request builder - * - * @return A token request builder - * @throws java.io.IOException If fail to update the access token - */ - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - /** - * Sets the token request builder - * - * @param tokenRequestBuilder Token request builder - */ - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - // Applying authorization to parameters is performed in the retryingIntercept method - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - // No implementation necessary - } -} -{{/hasOAuthMethods}} diff --git a/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache b/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache deleted file mode 100644 index c97cb87..0000000 --- a/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache +++ /dev/null @@ -1,169 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' -{{#sourceFolder}} -apply plugin: 'java' -{{/sourceFolder}} -apply plugin: 'com.diffplug.spotless' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' - } -} - -repositories { - mavenCentral() -} -{{#sourceFolder}} -sourceSets { - main.java.srcDirs = ['{{sourceFolder}}'] -} - -{{/sourceFolder}} -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - jakarta_annotation_version = "1.3.5" -} - -dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - {{/openApiNullable}} - {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' - {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - {{#joda}} - implementation 'joda-time:joda-time:2.9.9' - {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} - {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' - {{/dynamicOperations}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' -} - -javadoc { - options.tags = [ "http.response.details:a:Http Response Details" ] -} - -// Use spotless plugin to automatically format code, remove unused import, etc -// To apply changes directly to the file, run `gradlew spotlessApply` -// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -spotless { - // comment out below to run spotless as part of the `check` task - enforceCheck false - - format 'misc', { - // define the files (e.g. '*.gradle', '*.md') to apply `misc` to - target '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() // Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - // don't need to set target, it is inferred from java - - // apply a specific flavor of google-java-format - googleJavaFormat('1.8').aosp().reflowLongStrings() - - removeUnusedImports() - importOrder() - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache b/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache deleted file mode 100644 index 5e0c74c..0000000 --- a/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache +++ /dev/null @@ -1,39 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", - {{/openApiNullable}} - {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - {{/hasOAuthMethods}} - {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", - {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} - {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" - {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/templates/libraries/okhttp-gson-nextgen/model.mustache b/templates/libraries/okhttp-gson-nextgen/model.mustache deleted file mode 100644 index b6b0381..0000000 --- a/templates/libraries/okhttp-gson-nextgen/model.mustache +++ /dev/null @@ -1,61 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -{{#useReflectionEqualsHashCode}} -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -{{/useReflectionEqualsHashCode}} -import java.util.Objects; -import java.util.Arrays; -{{#imports}} -import {{import}}; -{{/imports}} -{{#serializableModel}} -import java.io.Serializable; -{{/serializableModel}} -{{#jackson}} -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -{{#withXml}} -import com.fasterxml.jackson.dataformat.xml.annotation.*; -{{/withXml}} -{{#vendorExtensions.x-has-readonly-properties}} -import com.fasterxml.jackson.annotation.JsonCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/jackson}} -{{#withXml}} -import javax.xml.bind.annotation.*; -{{/withXml}} -{{#jsonb}} -import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/jsonb}} -{{#parcelableModel}} -import android.os.Parcelable; -import android.os.Parcel; -{{/parcelableModel}} -{{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; -{{/useBeanValidation}} -{{#performBeanValidation}} -import org.hibernate.validator.constraints.*; -{{/performBeanValidation}} - -{{#models}} -{{#model}} -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} diff --git a/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache b/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache deleted file mode 100644 index ce88e9a..0000000 --- a/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ /dev/null @@ -1,242 +0,0 @@ -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import {{invokerPackage}}.JSON; - -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { - private static final Logger log = Logger.getLogger({{classname}}.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - {{#oneOf}} - final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); - {{/oneOf}} - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - {{#oneOf}} - // check if the actual instance is of the type `{{.}}` - if (value.getActualInstance() instanceof {{.}}) { - JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - {{/oneOf}} - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - // use discriminator value for faster oneOf lookup - {{classname}} new{{classname}} = new {{classname}}(); - String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{{mappingName}}}": - deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); - new{{classname}}.setActualInstance(deserialized); - return new{{classname}}; - {{/mappedModels}} - default: - log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - int match = 0; - TypeAdapter actualAdapter = elementAdapter; - - {{#oneOf}} - // deserialize {{{.}}} - try { - // validate the JSON object to see if any excpetion is thrown - {{.}}.validateJsonObject(jsonObject); - actualAdapter = adapter{{.}}; - match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); - } - - {{/oneOf}} - if (match == 1) { - {{classname}} ret = new {{classname}}(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); - return ret; - } - - throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); - - public {{classname}}() { - super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - } - - {{#oneOf}} - public {{classname}}({{{.}}} o) { - super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - setActualInstance(o); - } - - {{/oneOf}} - static { - {{#oneOf}} - schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { - }); - {{/oneOf}} - } - - @Override - public Map getSchemas() { - return {{classname}}.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} - * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). - */ - @Override - public void setActualInstance(Object instance) { - {{#isNullable}} - if (instance == null) { - super.setActualInstance(instance); - return; - } - - {{/isNullable}} - {{#oneOf}} - if (instance instanceof {{{.}}}) { - super.setActualInstance(instance); - return; - } - - {{/oneOf}} - throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); - } - - /** - * Get the actual instance, which can be the following: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} - * - * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - {{#oneOf}} - /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` - */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); - } - - {{/oneOf}} - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - {{#oneOf}} - // validate the json string with {{{.}}} - try { - {{{.}}}.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - // continue to the next one - } - {{/oneOf}} - if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); - } - } - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/templates/libraries/okhttp-gson-nextgen/pom.mustache b/templates/libraries/okhttp-gson-nextgen/pom.mustache deleted file mode 100644 index 10dfc15..0000000 --- a/templates/libraries/okhttp-gson-nextgen/pom.mustache +++ /dev/null @@ -1,420 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - {{artifactUrl}} - {{artifactDescription}} - - {{scmConnection}} - {{scmDeveloperConnection}} - {{scmUrl}} - -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - - - {{licenseName}} - {{licenseUrl}} - repo - - - - - - {{developerName}} - {{developerEmail}} - {{developerOrganization}} - {{developerOrganizationUrl}} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - true - 128m - 512m - - -Xlint:all - -J-Xss4m - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M5 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add_sources - generate-sources - - add-source - - - - {{{sourceFolder}}} - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.1 - - - attach-javadocs - - jar - - - - - none - - - http.response.details - a - Http Response Details: - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.0 - - - attach-sources - - jar-no-fork - - - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - - - - - 1.8 - - true - - - - - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.okhttp3 - okhttp - ${okhttp-version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - {{#hasOAuthMethods}} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - {{/hasOAuthMethods}} - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - {{#joda}} - - joda-time - joda-time - ${jodatime-version} - - {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} - {{#dynamicOperations}} - - io.swagger.parser.v3 - swagger-parser-v3 - 2.0.28 - - {{/dynamicOperations}} - {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - {{/useBeanValidation}} - {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.3.Final - - - jakarta.el - jakarta.el-api - ${jakarta.el-version} - - {{/performBeanValidation}} - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - {{#openApiNullable}} - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - {{/openApiNullable}} - - javax.ws.rs - jsr311-api - 1.1.1 - - - javax.ws.rs - javax.ws.rs-api - 2.0 - - - - junit - junit - ${junit-version} - test - - - org.mockito - mockito-core - 3.12.4 - test - - - - 1.8 - ${java.version} - ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} - {{#joda}} - 2.10.9 - {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} - 1.3.5 -{{#performBeanValidation}} - 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 - UTF-8 - 2.17.3 - - diff --git a/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache b/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache similarity index 94% rename from templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache rename to templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache index 3ba02e4..8d11435 100644 --- a/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache +++ b/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache @@ -6,14 +6,11 @@ import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; - -//import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -35,7 +32,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/templates/libraries/okhttp-gson/ApiClient.mustache b/templates/libraries/okhttp-gson/ApiClient.mustache index 421b778..c5e7ae2 100644 --- a/templates/libraries/okhttp-gson/ApiClient.mustache +++ b/templates/libraries/okhttp-gson/ApiClient.mustache @@ -23,11 +23,6 @@ import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#hasOAuthMethods}} import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -52,14 +47,13 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -72,6 +66,9 @@ import {{invokerPackage}}.auth.OAuth; import {{invokerPackage}}.auth.RetryingOAuth; import {{invokerPackage}}.auth.OAuthFlow; {{/hasOAuthMethods}} +{{#withAWSV4Signature}} +import {{invokerPackage}}.auth.AWS4Auth; +{{/withAWSV4Signature}} /** *

ApiClient class.

@@ -79,6 +76,33 @@ import {{invokerPackage}}.auth.OAuthFlow; public class ApiClient { private String basePath = "{{{basePath}}}"; + protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + new HashMap(){{#variables}}{{#-first}} {{ +{{/-first}} put("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new HashSet( + {{#enumValues}} + {{#-first}} + Arrays.asList( + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ) + {{/-last}} + {{/enumValues}} + ) + )); + {{#-last}} + }}{{/-last}}{{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ){{/-last}}{{/servers}}); + protected Integer serverIndex = 0; + protected Map serverVariables = null; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); private Map defaultCookieMap = new HashMap(); @@ -112,10 +136,11 @@ public class ApiClient { initHttpClient(); // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -131,10 +156,11 @@ public class ApiClient { httpClient = client; // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -186,8 +212,7 @@ public class ApiClient { this.basePath = basePath; } -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; + String tokenUrl = "{{{tokenUrl}}}"; if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { URI uri = URI.create(getBasePath()); tokenUrl = uri.getScheme() + ":" + @@ -197,17 +222,17 @@ public class ApiClient { throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); } } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, clientSecret, parameters); authentications.put( "{{name}}", retryingOAuth ); initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -267,6 +292,34 @@ public class ApiClient { */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; return this; } @@ -391,10 +444,10 @@ public class ApiClient { *

Setter for the field dateFormat.

* * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -402,21 +455,21 @@ public class ApiClient { *

Set SqlDateFormat.

* * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } {{#joda}} public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); + JSON.setDateTimeFormat(dateFormat); return this; } public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -425,22 +478,22 @@ public class ApiClient { /** *

Set OffsetDateTimeFormat.

* - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } /** *

Set LocalDateFormat.

* - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -449,10 +502,10 @@ public class ApiClient { *

Set LenientOnJson.

* * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -476,14 +529,23 @@ public class ApiClient { } {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -568,6 +630,51 @@ public class ApiClient { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + {{#withAWSV4Signature}} + for (Authentication auth : authentications.values()) { + if (auth instanceof AWS4Auth) { + ((AWS4Auth) auth).setCredentials(accessKey, secretKey); + ((AWS4Auth) auth).setRegion(region); + ((AWS4Auth) auth).setService(service); + return; + } + } + {{/withAWSV4Signature}} + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + {{#withAWSV4Signature}} + for (Authentication auth : authentications.values()) { + if (auth instanceof AWS4Auth) { + ((AWS4Auth) auth).setCredentials(accessKey, secretKey, sessionToken); + ((AWS4Auth) auth).setRegion(region); + ((AWS4Auth) auth).setService(service); + return; + } + } + {{/withAWSV4Signature}} + throw new RuntimeException("No AWS4 authentication configured!"); + } + /** * Set the User-Agent header's value (by adding to the default header map). * @@ -752,7 +859,7 @@ public class ApiClient { return ""; } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -760,7 +867,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -845,7 +952,7 @@ public class ApiClient { List params = new ArrayList(); // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { + if (param == null || param.getName() == null || param.getName().isEmpty() || value == null || value.isEmpty()) { return params; } @@ -880,6 +987,30 @@ public class ApiClient { } {{/dynamicOperations}} + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** * Formats the specified collection path parameter to a string value. * @@ -1011,7 +1142,7 @@ public class ApiClient { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * @throws {{invokerPackage}}.ApiException If fail to deserialize response body, i.e. cannot read response body * or the Content-Type of the response is not supported. */ @SuppressWarnings("unchecked") @@ -1052,7 +1183,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -1072,7 +1203,7 @@ public class ApiClient { * @param obj The Java object * @param contentType The request Content-Type * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object + * @throws {{invokerPackage}}.ApiException If fail to serialize the given object */ public RequestBody serialize(Object obj, String contentType) throws ApiException { if (obj instanceof byte[]) { @@ -1086,11 +1217,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1100,7 +1233,7 @@ public class ApiClient { * Download file from the given response. * * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @throws {{invokerPackage}}.ApiException If fail to read file content from response and write to disk * @return Downloaded file */ public File downloadFileFromResponse(Response response) throws ApiException { @@ -1164,7 +1297,7 @@ public class ApiClient { * @param Type * @param call An instance of the Call object * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call + * @throws {{invokerPackage}}.ApiException If fail to execute the call */ public ApiResponse execute(Call call) throws ApiException { return execute(call, null); @@ -1179,7 +1312,7 @@ public class ApiClient { * @return ApiResponse object containing response status, headers and * data, which is a Java object deserialized from response body and would be null * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call + * @throws {{invokerPackage}}.ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -1198,13 +1331,13 @@ public class ApiClient { * @param call a {@link okhttp3.Call} object * @param returnType a {@link java.lang.reflect.Type} object * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. + * @throws {{invokerPackage}}.ApiException if any. */ public InputStream executeStream(Call call, Type returnType) throws ApiException { try { Response response = call.execute(); if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); + throw new ApiException(response.code(), response.message(), response.headers().toMultimap(), null); } if (response.body() == null) { return null; @@ -1268,7 +1401,7 @@ public class ApiClient { * @param response Response * @param returnType Return type * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * @throws {{invokerPackage}}.ApiException If the response has an unsuccessful status code or * fail to deserialize the response body */ public T handleResponse(Response response, Type returnType) throws ApiException { @@ -1303,6 +1436,7 @@ public class ApiClient { /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1314,7 +1448,7 @@ public class ApiClient { * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object */ public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); @@ -1325,6 +1459,7 @@ public class ApiClient { /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1336,24 +1471,23 @@ public class ApiClient { * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object */ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; String contentType = headerParams.get("Content-Type"); - + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { + } else if ("multipart/form-data".equals(contentTypePure)) { reqBody = buildRequestBodyMultipart(formParams); } else if (body == null) { if ("DELETE".equals(method)) { @@ -1361,16 +1495,18 @@ public class ApiClient { reqBody = null; } else { // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); } } else { reqBody = serialize(body, contentType); } + List updatedQueryParams = new ArrayList<>(queryParams); + // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - final Request.Builder reqBuilder = new Request.Builder().url(url); + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); processHeaderParams(headerParams, reqBuilder); processCookieParams(cookieParams, reqBuilder); @@ -1393,6 +1529,7 @@ public class ApiClient { /** * Build full URL by concatenating base path, the given sub path and query parameters. * + * @param baseUrl The base URL * @param path The sub path * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters @@ -1403,7 +1540,18 @@ public class ApiClient { if (baseUrl != null) { url.append(baseUrl).append(path); } else { - url.append(basePath).append(path); + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); } if (queryParams != null && !queryParams.isEmpty()) { @@ -1487,6 +1635,7 @@ public class ApiClient { * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws {{invokerPackage}}.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { @@ -1525,12 +1674,18 @@ public class ApiClient { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); } } return mpBuilder.build(); @@ -1551,6 +1706,44 @@ public class ApiClient { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. @@ -1618,7 +1811,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); @@ -1693,7 +1886,7 @@ public class ApiClient { if (entry.getKey().equals(param.getName())) { switch (param.getIn()) { case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); + path = path.replace("{" + param.getName() + "}", escapeString(value.toString())); break; case "query": if (value instanceof Collection) { @@ -1722,9 +1915,9 @@ public class ApiClient { /** * Convert the HTTP request body to a string. * - * @param request The HTTP request object + * @param requestBody The HTTP request object * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object into a string */ private String requestBodyToString(RequestBody requestBody) throws ApiException { if (requestBody != null) { diff --git a/templates/libraries/okhttp-gson-nextgen/JSON.mustache b/templates/libraries/okhttp-gson/JSON.mustache similarity index 93% rename from templates/libraries/okhttp-gson-nextgen/JSON.mustache rename to templates/libraries/okhttp-gson/JSON.mustache index 32bef19..6cf7ec7 100644 --- a/templates/libraries/okhttp-gson-nextgen/JSON.mustache +++ b/templates/libraries/okhttp-gson/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} import okio.ByteString; @@ -33,11 +28,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; @@ -116,29 +109,29 @@ public class JSON { return clazz; } - { - gson = createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - {{#joda}} - .registerTypeAdapter(DateTime.class, dateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - {{/joda}} - {{#jsr310}} - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - {{/jsr310}} - .registerTypeAdapter(byte[].class, byteArrayAdapter) - {{#models}} - {{#model}} - {{^isEnum}} - {{^hasChildren}} - .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/hasChildren}} - {{/isEnum}} - {{/model}} - {{/models}} - .create(); + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + {{#joda}} + gsonBuilder.registerTypeAdapter(DateTime.class, dateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + {{/joda}} + {{#jsr310}} + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + {{/jsr310}} + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + {{#models}} + {{#model}} + {{^isEnum}} + {{^hasChildren}} + gsonBuilder.registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()); + {{/hasChildren}} + {{/isEnum}} + {{/model}} + {{/models}} + gson = gsonBuilder.create(); } /** diff --git a/templates/libraries/okhttp-gson/README.mustache b/templates/libraries/okhttp-gson/README.mustache index a1a142b..8dbdf24 100644 --- a/templates/libraries/okhttp-gson/README.mustache +++ b/templates/libraries/okhttp-gson/README.mustache @@ -5,6 +5,7 @@ {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} + - Generator version: {{generatorVersion}} {{{appDescriptionWithNewLines}}} @@ -18,7 +19,7 @@ ## Requirements Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation @@ -96,6 +97,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("{{{basePath}}}"); + {{#withAWSV4Signature}} + // Configure AWS Signature V4 authorization + defaultClient.setAWS4Configuration("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "REGION", "SERVICE") + {{/withAWSV4Signature}} {{#hasAuthMethods}} {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -151,18 +156,25 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}}- **Type**: API key - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/templates/libraries/okhttp-gson/additional_properties.mustache b/templates/libraries/okhttp-gson/additional_properties.mustache new file mode 100644 index 0000000..bca54f8 --- /dev/null +++ b/templates/libraries/okhttp-gson/additional_properties.mustache @@ -0,0 +1,46 @@ +{{#isAdditionalPropertiesTrue}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the {{classname}} instance itself + */ + public {{classname}} putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/isAdditionalPropertiesTrue}} diff --git a/templates/libraries/okhttp-gson/anyof_model.mustache b/templates/libraries/okhttp-gson/anyof_model.mustache new file mode 100644 index 0000000..18447fc --- /dev/null +++ b/templates/libraries/okhttp-gson/anyof_model.mustache @@ -0,0 +1,398 @@ + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#composedSchemas}} + {{#anyOf}} + {{^isArray}} + {{^vendorExtensions.x-duplicated-data-type}} + final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); + {{/vendorExtensions.x-duplicated-data-type}} + {{/isArray}} + {{#isArray}} + + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isArray}} + {{/anyOf}} + {{/composedSchemas}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isPrimitiveType}} + JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isArray}} + List list = (List) value.getActualInstance(); + if (list.get(0) instanceof {{{items.dataType}}}) { + JsonArray array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonArray(); + elementAdapter.write(out, array); + return; + } + {{/isArray}} + {{/isPrimitiveType}} + {{^isArray}} + {{^isPrimitiveType}} + JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); + elementAdapter.write(out, element); + return; + {{/isPrimitiveType}} + {{/isArray}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isArray}} + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{.}}; + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + throw new IOException(String.format("Failed deserialization for {{classname}}: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public {{classname}}() { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + public {{classname}}(Object o) { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + static { + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + schemas.put("{{{dataType}}}", {{{baseType}}}.class); + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (instance instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isArray}} + List list = (List) instance; + if (list.get(0) instanceof {{{items.dataType}}}) { + super.setActualInstance(instance); + return; + } + {{/isArray}} + {{^isArray}} + super.setActualInstance(instance); + return; + {{/isArray}} + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + public {{{dataType}}} get{{#isArray}}{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // validate the json string with {{{dataType}}} + try { + {{^hasVars}} + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isArray}} + {{/hasVars}} + {{#hasVars}} + {{{.}}}.validateJsonElement(jsonElement); + return; + {{/hasVars}} + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + // continue to the next one + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/templates/libraries/okhttp-gson/api.mustache b/templates/libraries/okhttp-gson/api.mustache index e81f874..96757ed 100644 --- a/templates/libraries/okhttp-gson/api.mustache +++ b/templates/libraries/okhttp-gson/api.mustache @@ -26,13 +26,14 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.io.IOException; {{#useBeanValidation}} -import javax.validation.constraints.*; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.executable.ExecutableValidator; import java.util.Set; import java.lang.reflect.Method; import java.lang.reflect.Type; @@ -42,7 +43,6 @@ import java.lang.reflect.Type; {{/imports}} import java.lang.reflect.Type; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -50,7 +50,6 @@ import java.util.Map; {{#supportStreaming}} import java.io.InputStream; {{/supportStreaming}} -{{/fullJavaUtil}} {{#operations}} public class {{classname}} { @@ -119,7 +118,6 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { {{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}} }; @@ -137,7 +135,7 @@ public class {{classname}} { // create path and map variables {{^dynamicOperations}} String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; + .replace("{" + "{{baseName}}" + "}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; {{/dynamicOperations}} {{#dynamicOperations}} ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); @@ -156,11 +154,11 @@ public class {{classname}} { {{/allParams}} {{/dynamicOperations}} - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#formParams}} if ({{paramName}} != null) { @@ -171,29 +169,52 @@ public class {{classname}} { {{^dynamicOperations}} {{#queryParams}} if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#isFreeFormObject}}localVarQueryParams.addAll(localVarApiClient.freeFormParameterToPairs({{paramName}}));{{/isFreeFormObject}}{{^isFreeFormObject}}{{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));{{/isFreeFormObject}} } {{/queryParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarCollectionQueryParams.add(new Pair("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}})); + + {{/isQueryParam}} + {{/constantParams}} {{#headerParams}} if ({{paramName}} != null) { localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); } {{/headerParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarHeaderParams.put("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}}); + + {{/isHeaderParam}} + {{/constantParams}} {{#cookieParams}} if ({{paramName}} != null) { localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); } {{/cookieParams}} + {{#constantParams}} + {{#isCookieParam}} + // Set client side default value of Cookie Param "{{baseName}}". + localVarCookieParams.put("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}}); + + {{/isCookieParam}} + {{/constantParams}} {{/dynamicOperations}} {{#dynamicOperations}} localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); {{/dynamicOperations}} final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -201,14 +222,16 @@ public class {{classname}} { } final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#withAWSV4Signature}}"AWS4Auth"{{/withAWSV4Signature}}{{#authMethods}}{{#-first}}{{#withAWSV4Signature}}, {{/withAWSV4Signature}}{{/-first}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; return localVarApiClient.buildCall(basePath, localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -218,15 +241,16 @@ public class {{classname}} { @SuppressWarnings("rawtypes") private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { {{^performBeanValidation}} - {{#allParams}}{{#required}} + {{#allParams}} + {{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); } - {{/required}}{{/allParams}} - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; + {{/required}} + {{/allParams}} + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); {{/performBeanValidation}} {{#performBeanValidation}} @@ -240,9 +264,7 @@ public class {{classname}} { parameterValues); if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); } else { throw new BeanValidationException((Set) violations); } @@ -253,7 +275,6 @@ public class {{classname}} { e.printStackTrace(); throw new ApiException(e.getMessage()); } - {{/performBeanValidation}} } @@ -326,13 +347,42 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + {{#returnType}} + {{#errorObjectType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}>(){}.getType())); + throw e; + } + {{/errorObjectType}} + {{^errorObjectType}} + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + {{/errorObjectType}} + {{/returnType}} } {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + {{^returnType}} + return localVarApiClient.execute(localVarCall); + {{/returnType}} + {{#returnType}} + {{#errorObjectType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}>(){}.getType())); + throw e; + } + {{/errorObjectType}} + {{^errorObjectType}} + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + {{/errorObjectType}} + {{/returnType}} } {{/vendorExtensions.x-streaming}} @@ -443,10 +493,17 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-streaming}} public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } + {{/vendorExtensions.x-streaming}} + {{#vendorExtensions.x-streaming}} + public InputStream execute() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/vendorExtensions.x-streaming}} /** * Execute {{operationId}} request with HTTP info returned @@ -468,9 +525,16 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-streaming}} public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } + {{/vendorExtensions.x-streaming}} + {{#vendorExtensions.x-streaming}} + public InputStream executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/vendorExtensions.x-streaming}} /** * Execute {{operationId}} request (asynchronously) diff --git a/templates/libraries/okhttp-gson/apiException.mustache b/templates/libraries/okhttp-gson/apiException.mustache index 4bec51d..3cd6eda 100644 --- a/templates/libraries/okhttp-gson/apiException.mustache +++ b/templates/libraries/okhttp-gson/apiException.mustache @@ -9,16 +9,22 @@ import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} + /** *

ApiException class.

*/ @SuppressWarnings("serial") {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - + {{#errorObjectType}} + private {{{errorObjectType}}} errorObject = null; + {{/errorObjectType}} + /** *

Constructor for ApiException.

*/ @@ -96,7 +102,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us * @param responseBody the response body */ public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } /** @@ -156,4 +162,34 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } + {{#errorObjectType}} + + /** + * Get the error object. + * + * @return Error object + */ + public {{{errorObjectType}}} getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject({{{errorObjectType}}} errorObject) { + this.errorObject = errorObject; + } + {{/errorObjectType}} } diff --git a/templates/libraries/okhttp-gson/api_doc.mustache b/templates/libraries/okhttp-gson/api_doc.mustache index 5a4e396..dea75bd 100644 --- a/templates/libraries/okhttp-gson/api_doc.mustache +++ b/templates/libraries/okhttp-gson/api_doc.mustache @@ -3,14 +3,14 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} - + # **{{operationId}}**{{^vendorExtensions.x-group-parameters}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} @@ -33,6 +33,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("{{{basePath}}}"); + {{#withAWSV4Signature}} + // Configure AWS Signature V4 authorization + defaultClient.setAWS4Configuration("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "REGION", "SERVICE") + {{/withAWSV4Signature}} {{#hasAuthMethods}} {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -75,9 +79,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type @@ -98,7 +102,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| {{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | {{/responses}} {{/responses.0}} diff --git a/templates/libraries/okhttp-gson/api_test.mustache b/templates/libraries/okhttp-gson/api_test.mustache index 98a30a6..29f6826 100644 --- a/templates/libraries/okhttp-gson/api_test.mustache +++ b/templates/libraries/okhttp-gson/api_test.mustache @@ -5,10 +5,9 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -16,24 +15,32 @@ import java.util.Map; {{#supportStreaming}} import java.io.InputStream; {{/supportStreaming}} -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * - * @throws ApiException - * if the Api call fails + {{/notes}} + * @throws ApiException if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { @@ -41,16 +48,18 @@ public class {{classname}}Test { {{{dataType}}} {{paramName}} = null; {{/allParams}} {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} {{/vendorExtensions.x-streaming}} {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} {{/vendorExtensions.x-streaming}} // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache b/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache new file mode 100644 index 0000000..24bfb4c --- /dev/null +++ b/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache @@ -0,0 +1,104 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.List; +import java.util.stream.Collectors; + +import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsSessionCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentials; +import software.amazon.awssdk.auth.signer.Aws4Signer; +import software.amazon.awssdk.auth.signer.params.Aws4SignerParams; +import software.amazon.awssdk.http.ContentStreamProvider; +import software.amazon.awssdk.http.SdkHttpFullRequest; +import software.amazon.awssdk.http.SdkHttpMethod; +import software.amazon.awssdk.regions.Region; + +import okio.Buffer; + +{{>generatedAnnotation}} +public class AWS4Auth implements Authentication { + + private AwsCredentials credentials; + private String region; + private String service; + + public AWS4Auth() { + this.credentials = AnonymousCredentialsProvider.create().resolveCredentials(); + } + + public void setCredentials(String accessKey, String secretKey) { + this.credentials = AwsBasicCredentials.create(accessKey, secretKey); + } + + public void setCredentials(String accessKey, String secretKey, String sessionToken) { + this.credentials = AwsSessionCredentials.create(accessKey, secretKey, sessionToken); + } + + public void setRegion(String region) { + this.region = region; + } + + public void setService(String service) { + this.service = service; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) + throws ApiException { + + SdkHttpFullRequest.Builder requestBuilder = + SdkHttpFullRequest.builder().uri(uri).method(SdkHttpMethod.fromValue(method)); + + ContentStreamProvider provider = new ContentStreamProvider() { + @Override + public InputStream newStream() { + InputStream is = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8)); + return is; + } + }; + + requestBuilder = requestBuilder.contentStreamProvider(provider); + + SdkHttpFullRequest signableRequest = sign(requestBuilder); + + Map headers = signableRequest.headers().entrySet().stream() + .collect(Collectors.toMap(s -> s.getKey(), e -> e.getValue().get(0))); + + headerParams.putAll(headers); + } + + /** + * AWS Signature Version 4 signing. + * + * @param request {@link SdkHttpFullRequest.Builder} + * @return {@link SdkHttpFullRequest} + */ + private SdkHttpFullRequest sign(final SdkHttpFullRequest.Builder request) { + + SdkHttpFullRequest req = request.build(); + + if (this.service != null && this.region != null && this.credentials != null) { + Aws4SignerParams params = Aws4SignerParams.builder().signingName(this.service) + .signingRegion(Region.of(this.region)).awsCredentials(this.credentials).build(); + + Aws4Signer signer = Aws4Signer.create(); + + req = signer.sign(req, params); + } + + return req; + } +} diff --git a/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache b/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache index 417a89e..41f3367 100644 --- a/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache +++ b/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache @@ -11,8 +11,6 @@ import java.net.URI; import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache b/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache index c8a9fce..abe1cb8 100644 --- a/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache +++ b/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache @@ -6,13 +6,15 @@ import {{invokerPackage}}.ApiException; import {{invokerPackage}}.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -24,7 +26,7 @@ public class HttpBearerAuth implements Authentication { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -33,12 +35,22 @@ public class HttpBearerAuth implements Authentication { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache b/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache index cb0e825..67d7f72 100644 --- a/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache +++ b/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + {{#hasOAuthMethods}} package {{invokerPackage}}.auth; @@ -56,6 +58,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 137e266..fbe73e7 100644 --- a/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + {{#hasOAuthMethods}} package {{invokerPackage}}.auth; @@ -29,22 +31,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -57,24 +68,29 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: + case ACCESS_CODE: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case implicit: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: @@ -116,8 +132,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); @@ -148,8 +164,12 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -166,10 +186,20 @@ public class RetryingOAuth extends OAuth implements Interceptor { return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/templates/libraries/okhttp-gson/build.gradle.mustache b/templates/libraries/okhttp-gson/build.gradle.mustache index c97cb87..eb67fc1 100644 --- a/templates/libraries/okhttp-gson/build.gradle.mustache +++ b/templates/libraries/okhttp-gson/build.gradle.mustache @@ -14,8 +14,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -66,10 +66,10 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) } } @@ -110,31 +110,33 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' {{/openApiNullable}} + {{#withAWSV4Signature}} + implementation 'software.amazon.awssdk:auth:2.20.157' + {{/withAWSV4Signature}} {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' {{#joda}} implementation 'joda-time:joda-time:2.9.9' {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' + implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' {{/dynamicOperations}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { @@ -167,3 +169,17 @@ spotless { importOrder() } } + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/templates/libraries/okhttp-gson/build.sbt.mustache b/templates/libraries/okhttp-gson/build.sbt.mustache index 5e0c74c..2045b84 100644 --- a/templates/libraries/okhttp-gson/build.sbt.mustache +++ b/templates/libraries/okhttp-gson/build.sbt.mustache @@ -9,31 +9,33 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} + {{#withAWSV4Signature}} + "software.amazon.awssdk" % "auth" % "2.20.157", + {{/withAWSV4Signature}} {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", {{/hasOAuthMethods}} {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" + "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.30" % "compile" {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/templates/libraries/okhttp-gson/model.mustache b/templates/libraries/okhttp-gson/model.mustache new file mode 100644 index 0000000..c82b0fb --- /dev/null +++ b/templates/libraries/okhttp-gson/model.mustache @@ -0,0 +1,35 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +import java.util.Objects; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +{{/withXml}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/templates/libraries/okhttp-gson/modelEnum.mustache b/templates/libraries/okhttp-gson/modelEnum.mustache new file mode 100644 index 0000000..b955e53 --- /dev/null +++ b/templates/libraries/okhttp-gson/modelEnum.mustache @@ -0,0 +1,85 @@ +import java.io.IOException; +{{#isUri}} +import java.net.URI; +{{/isUri}} +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isUri}}URI.create({{/isUri}}jsonElement.{{#isNumber}}getAsString(){{/isNumber}}{{#isInteger}}getAsInt(){{/isInteger}}{{#isUri}}getAsString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}getAs{{{dataType}}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} +} diff --git a/templates/libraries/okhttp-gson/modelInnerEnum.mustache b/templates/libraries/okhttp-gson/modelInnerEnum.mustache new file mode 100644 index 0000000..06912e9 --- /dev/null +++ b/templates/libraries/okhttp-gson/modelInnerEnum.mustache @@ -0,0 +1,66 @@ + /** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isUri}}URI.create({{/isUri}}jsonElement.{{#isNumber}}getAsString(){{/isNumber}}{{#isInteger}}getAsInt(){{/isInteger}}{{#isUri}}getAsString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}getAs{{{dataType}}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } diff --git a/templates/libraries/okhttp-gson/model_test.mustache b/templates/libraries/okhttp-gson/model_test.mustache new file mode 100644 index 0000000..040d319 --- /dev/null +++ b/templates/libraries/okhttp-gson/model_test.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/templates/libraries/okhttp-gson/oneof_model.mustache b/templates/libraries/okhttp-gson/oneof_model.mustache new file mode 100644 index 0000000..31c6326 --- /dev/null +++ b/templates/libraries/okhttp-gson/oneof_model.mustache @@ -0,0 +1,512 @@ + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#composedSchemas}} + {{#oneOf}} + {{^isArray}} + {{^isMap}} + {{^vendorExtensions.x-duplicated-data-type}} + final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); + {{/vendorExtensions.x-duplicated-data-type}} + {{/isMap}} + {{/isArray}} + {{#isArray}} + + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isArray}} + {{#isMap}} + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isMap}} + {{/oneOf}} + {{/composedSchemas}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { + {{#isPrimitiveType}} + {{^isMap}} + JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + {{/isMap}} + {{#isMap}} + JsonObject object = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, object); + return; + {{/isMap}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isArray}} + List list = (List) value.getActualInstance(); + if (list.get(0) instanceof {{{items.dataType}}}) { + JsonArray array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonArray(); + elementAdapter.write(out, array); + return; + } + {{/isArray}} + {{/isPrimitiveType}} + {{^isMap}} + {{^isArray}} + {{^isPrimitiveType}} + JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); + elementAdapter.write(out, element); + return; + {{/isPrimitiveType}} + {{/isArray}} + {{/isMap}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + {{classname}} new{{classname}} = new {{classname}}(); + if (jsonObject.get("{{{propertyBaseName}}}") == null) { + log.log(Level.WARNING, "Failed to lookup discriminator value for {{classname}} as `{{{propertyBaseName}}}` was not found in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `{{{propertyBaseName}}}` + switch (jsonObject.get("{{{propertyBaseName}}}").getAsString()) { + {{#mappedModels}} + case "{{{mappingName}}}": + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); + new{{classname}}.setActualInstance(deserialized); + return new{{classname}}; + {{/mappedModels}} + default: + log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", jsonObject.get("{{{propertyBaseName}}}").getAsString())); + } + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{^isMap}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{/isMap}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isMap}} + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{.}}; + match++; + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + if (match == 1) { + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public {{classname}}() { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + public {{classname}}(Object o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + static { + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + schemas.put("{{{dataType}}}", {{{baseType}}}.class); + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (instance instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { + {{#isArray}} + List list = (List) instance; + if (list.get(0) instanceof {{{items.dataType}}}) { + super.setActualInstance(instance); + return; + } + {{/isArray}} + {{^isArray}} + super.setActualInstance(instance); + return; + {{/isArray}} + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // validate the json string with {{{dataType}}} + try { + {{^hasVars}} + {{^isMap}} + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{/isMap}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + {{/isMap}} + {{/hasVars}} + {{#hasVars}} + {{{.}}}.validateJsonElement(jsonElement); + validCount++; + {{/hasVars}} + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + // continue to the next one + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/templates/libraries/okhttp-gson/pojo.mustache b/templates/libraries/okhttp-gson/pojo.mustache new file mode 100644 index 0000000..0a32ef0 --- /dev/null +++ b/templates/libraries/okhttp-gson/pojo.mustache @@ -0,0 +1,591 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import {{invokerPackage}}.JSON; + +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{/withXml}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + + {{/vars}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super(); + {{/parcelableModel}} + {{/parent}} + {{#discriminator}} + {{^discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + + public {{classname}}( + {{#readOnlyVars}} + {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} + public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#deprecated}} @Deprecated +{{/deprecated}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/okhttp-gson/additional_properties}} + + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && + {{/-last}}{{/vars}}{{#isAdditionalPropertiesTrue}}&& + Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/isAdditionalPropertiesTrue}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#isAdditionalPropertiesTrue}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/isAdditionalPropertiesTrue}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} +{{#isAdditionalPropertiesTrue}} + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); +{{/isAdditionalPropertiesTrue}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + {{#allVars}} + openapiFields.add("{{baseName}}"); + {{/allVars}} + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + {{#requiredVars}} + openapiRequiredFields.add("{{baseName}}"); + {{/requiredVars}} + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!{{classname}}.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); + } + } + {{^hasChildren}} + {{^isAdditionalPropertiesTrue}} + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!{{classname}}.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + {{/isAdditionalPropertiesTrue}} + {{#requiredVars}} + {{#-first}} + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : {{classname}}.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + {{/-first}} + {{/requiredVars}} + {{/hasChildren}} + {{^discriminator}} + {{#hasVars}} + JsonObject jsonObj = jsonElement.getAsJsonObject(); + {{/hasVars}} + {{#vars}} + {{#isArray}} + {{#items.isModel}} + {{#required}} + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + // validate the required field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonElement(jsonArray{{name}}.get(i)); + }; + {{/required}} + {{^required}} + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + if (jsonArray{{name}} != null) { + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + + // validate the optional field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonElement(jsonArray{{name}}.get(i)); + }; + } + } + {{/required}} + {{/items.isModel}} + {{^items.isModel}} + {{^required}} + // ensure the optional json data is an array if present + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull() && !jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} + {{#required}} + // ensure the required json array is present + if (jsonObj.get("{{{baseName}}}") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} + {{/items.isModel}} + {{/isArray}} + {{^isContainer}} + {{#isString}} + if ({{#notRequiredOrIsNullable}}(jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) && {{/notRequiredOrIsNullable}}!jsonObj.get("{{{baseName}}}").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/isString}} + {{#isModel}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isModel}} + {{#isEnum}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{datatypeWithEnum}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{datatypeWithEnum}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isEnum}} + {{#isEnumRef}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isEnumRef}} + {{/isContainer}} + {{/vars}} + {{/discriminator}} + {{#hasChildren}} + {{#discriminator}} + + String discriminatorValue = jsonElement.getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{mappingName}}": + {{modelName}}.validateJsonElement(jsonElement); + break; + {{/mappedModels}} + default: + throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + {{/discriminator}} + {{/hasChildren}} + } + +{{^hasChildren}} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<{{classname}}> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + {{#isAdditionalPropertiesTrue}} + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + {{/isAdditionalPropertiesTrue}} + elementAdapter.write(out, obj); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + {{#isAdditionalPropertiesTrue}} + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + {{classname}} instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + {{/isAdditionalPropertiesTrue}} + {{^isAdditionalPropertiesTrue}} + return thisAdapter.fromJsonTree(jsonElement); + {{/isAdditionalPropertiesTrue}} + } + + }.nullSafe(); + } + } +{{/hasChildren}} + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/templates/libraries/okhttp-gson/pom.mustache b/templates/libraries/okhttp-gson/pom.mustache index 94c057b..def53f2 100644 --- a/templates/libraries/okhttp-gson/pom.mustache +++ b/templates/libraries/okhttp-gson/pom.mustache @@ -57,7 +57,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.4.1 enforce-maven @@ -77,21 +77,30 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin + 3.6.1 package @@ -108,7 +117,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -122,7 +131,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.5.0 add_sources @@ -153,7 +162,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.6.3 attach-javadocs @@ -176,7 +185,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.3.0 attach-sources @@ -239,7 +248,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.1 sign-artifacts @@ -256,11 +265,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations - ${swagger-core-version} + ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -291,7 +309,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 {{/hasOAuthMethods}} @@ -306,18 +324,11 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#dynamicOperations}} io.swagger.parser.v3 swagger-parser-v3 - 2.0.28 + 2.0.30 {{/dynamicOperations}} {{#useBeanValidation}} @@ -364,17 +375,29 @@ ${jackson-databind-nullable-version} {{/openApiNullable}} + {{#withAWSV4Signature}} + + software.amazon.awssdk + auth + 2.20.157 + + {{/withAWSV4Signature}} + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} + - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test - org.mockito - mockito-core - 3.12.4 + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} test @@ -382,29 +405,39 @@ 1.8 ${java.version} ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 + 1.9.0 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 4.12.0 + 2.10.1 + 3.14.0 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} {{#joda}} - 2.10.9 + 2.12.0 {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#performBeanValidation}} + {{/useJakartaEe}} + {{#performBeanValidation}} 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 + {{/performBeanValidation}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.3 + 1.10.0 + 2.1.6 + 1.1.1 UTF-8 - 2.17.3 + 2.43.0 diff --git a/templates/libraries/rest-assured/ApiClient.mustache b/templates/libraries/rest-assured/ApiClient.mustache index 2a0f417..aa84b2b 100644 --- a/templates/libraries/rest-assured/ApiClient.mustache +++ b/templates/libraries/rest-assured/ApiClient.mustache @@ -6,7 +6,6 @@ import {{apiPackage}}.*; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import io.restassured.builder.RequestSpecBuilder; import java.util.function.Consumer; import java.util.function.Supplier; @@ -15,8 +14,6 @@ import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; -{{/fullJavaUtil}} - public class ApiClient { {{#basePath}} public static final String BASE_URI = "{{.}}"; diff --git a/templates/libraries/rest-assured/JacksonObjectMapper.mustache b/templates/libraries/rest-assured/JacksonObjectMapper.mustache index 6af705a..8919eda 100644 --- a/templates/libraries/rest-assured/JacksonObjectMapper.mustache +++ b/templates/libraries/rest-assured/JacksonObjectMapper.mustache @@ -2,23 +2,15 @@ package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import io.restassured.internal.mapping.Jackson2Mapper; import io.restassured.path.json.mapper.factory.Jackson2ObjectMapperFactory; @@ -41,19 +33,10 @@ public class JacksonObjectMapper extends Jackson2Mapper { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} mapper.registerModule(new JavaTimeModule()); - {{/java8}} {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -65,4 +48,4 @@ public class JacksonObjectMapper extends Jackson2Mapper { public static JacksonObjectMapper jackson() { return new JacksonObjectMapper(); } -} \ No newline at end of file +} diff --git a/templates/libraries/rest-assured/api.mustache b/templates/libraries/rest-assured/api.mustache index 8d46025..5ae6e50 100644 --- a/templates/libraries/rest-assured/api.mustache +++ b/templates/libraries/rest-assured/api.mustache @@ -8,7 +8,6 @@ import com.google.gson.reflect.TypeToken; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -22,19 +21,37 @@ import io.restassured.common.mapper.TypeRef; {{/jackson}} import io.restassured.http.Method; import io.restassured.response.Response; +{{#swagger1AnnotationLibrary}} import io.swagger.annotations.*; +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.*; +import io.swagger.v3.oas.annotations.security.*; +{{/swagger2AnnotationLibrary}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} import java.lang.reflect.Type; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; -{{/fullJavaUtil}} {{#gson}} import {{invokerPackage}}.JSON; {{/gson}} import static io.restassured.http.Method.*; +{{#swagger1AnnotationLibrary}} @Api(value = "{{{baseName}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +@Tag(name = "{{{baseName}}}") +{{/swagger2AnnotationLibrary}} public class {{classname}} { private Supplier reqSpecSupplier; @@ -68,12 +85,22 @@ public class {{classname}} { {{#operations}} {{#operation}} +{{#swagger1AnnotationLibrary}} @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", nickname = "{{{operationId}}}", tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Operation(summary = "{{{summary}}}", + description = "{{{notes}}}", + operationId = "{{{operationId}}}", + tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) +{{/swagger2AnnotationLibrary}} {{#isDeprecated}} @Deprecated {{/isDeprecated}} @@ -127,12 +154,10 @@ public class {{classname}} { public {{operationIdCamelCase}}Oper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; {{#vendorExtensions}} - {{#x-contentType}} - reqSpec.setContentType("{{x-contentType}}"); - {{/x-contentType}} - {{#x-accepts}} - reqSpec.setAccept("{{x-accepts}}"); - {{/x-accepts}} + {{#x-content-type}} + reqSpec.setContentType("{{x-content-type}}"); + {{/x-content-type}} + reqSpec.setAccept("{{#x-accepts}}{{.}}{{^-last}},{{/-last}}{{/x-accepts}}"); {{/vendorExtensions}} this.respSpec = new ResponseSpecBuilder(); } diff --git a/templates/libraries/rest-assured/api_doc.mustache b/templates/libraries/rest-assured/api_doc.mustache index c000bc9..42d223a 100644 --- a/templates/libraries/rest-assured/api_doc.mustache +++ b/templates/libraries/rest-assured/api_doc.mustache @@ -3,14 +3,14 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} - + # **{{operationId}}** > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) @@ -40,9 +40,9 @@ api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/templates/libraries/rest-assured/api_test.mustache b/templates/libraries/rest-assured/api_test.mustache index 74a1c9f..d7d9dae 100644 --- a/templates/libraries/rest-assured/api_test.mustache +++ b/templates/libraries/rest-assured/api_test.mustache @@ -8,16 +8,22 @@ import {{invokerPackage}}.ApiClient; import {{apiPackage}}.{{classname}}; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; @@ -25,12 +31,12 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -63,4 +69,4 @@ public class {{classname}}Test { {{/responses}} {{/operation}} {{/operations}} -} \ No newline at end of file +} diff --git a/templates/libraries/rest-assured/build.gradle.mustache b/templates/libraries/rest-assured/build.gradle.mustache index e80ea18..3ddee45 100644 --- a/templates/libraries/rest-assured/build.gradle.mustache +++ b/templates/libraries/rest-assured/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -97,35 +97,39 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.21" - rest_assured_version = "4.3.0" - junit_version = "4.13.1" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.6" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.15" + {{/swagger2AnnotationLibrary}} + rest_assured_version = "5.3.2" + junit_version = "5.10.3" {{#jackson}} - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.10.0" - {{/threetenbp}} {{/jackson}} {{#gson}} - gson_version = "2.8.6" - gson_fire_version = "1.8.4" + gson_version = "2.10.1" + gson_fire_version = "1.9.0" {{/gson}} {{#joda}} jodatime_version = "2.10.5" {{/joda}} -{{#threetenbp}} - threetenbp_version = "1.4.3" -{{/threetenbp}} - okio_version = "1.17.5" + okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.rest-assured:rest-assured:$rest_assured_version" {{#jackson}} @@ -142,12 +146,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} {{/jackson}} {{#gson}} implementation "io.gsonfire:gson-fire:$gson_fire_version" @@ -156,16 +155,13 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} -{{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" -{{/threetenbp}} implementation "com.squareup.okio:okio:$okio_version" {{#useBeanValidation}} - implementation "jakarta.validation:jakarta.validation-api:2.0.2" + implementation "jakarta.validation:jakarta.validation-api:3.0.2" {{/useBeanValidation}} {{#performBeanValidation}} implementation "org.hibernate:hibernate-validator:6.0.19.Final" {{/performBeanValidation}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/templates/libraries/rest-assured/build.sbt.mustache b/templates/libraries/rest-assured/build.sbt.mustache index 6a048b9..ce4037a 100644 --- a/templates/libraries/rest-assured/build.sbt.mustache +++ b/templates/libraries/rest-assured/build.sbt.mustache @@ -9,49 +9,41 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.21", - "io.rest-assured" % "rest-assured" % "4.3.0", - "io.rest-assured" % "scala-support" % "4.3.0", + "io.swagger" % "swagger-annotations" % "1.6.6", + "io.rest-assured" % "rest-assured" % "4.5.1", + "io.rest-assured" % "scala-support" % "4.5.1", "com.google.code.findbugs" % "jsr305" % "3.0.2", {{#jackson}} - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} {{#withXml}} - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1", {{/withXml}} {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.3", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.4.1", {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.10.0", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.4.1", {{/jackson}} {{#gson}} - "com.google.code.gson" % "gson" % "2.8.6", - "io.gsonfire" % "gson-fire" % "1.8.4" % "compile", + "com.google.code.gson" % "gson" % "2.8.9", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", {{/gson}} {{#joda}} "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} -{{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", -{{/threetenbp}} "com.squareup.okio" % "okio" % "1.17.5" % "compile", {{#useBeanValidation}} - "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", + "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", {{/useBeanValidation}} {{#performBeanValidation}} "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", {{/performBeanValidation}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/templates/libraries/rest-assured/pom.mustache b/templates/libraries/rest-assured/pom.mustache index c6e924e..396dd69 100644 --- a/templates/libraries/rest-assured/pom.mustache +++ b/templates/libraries/rest-assured/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.22.2 - + loggerPath conf/log4j.properties - + false 1C @@ -150,7 +150,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.2 none 1.8 @@ -219,11 +219,20 @@ {{/jackson}} + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -255,13 +264,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#gson}} io.gsonfire @@ -300,19 +302,10 @@ jackson-datatype-joda {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} {{/jackson}} com.squareup.okio @@ -338,36 +331,41 @@ {{/performBeanValidation}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.21 - 4.3.0 - 2.8.6 - 1.8.4 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 5.3.2 + 2.10.1 + 1.9.0 {{#joda}} 2.10.5 {{/joda}} - {{#threetenbp}} - 1.4.3 - {{/threetenbp}} {{#jackson}} - 2.10.3 - 0.2.2 - {{#threetenbp}} - 2.10.0 - {{/threetenbp}} + 2.17.1 + 2.17.1 + 0.2.6 {{/jackson}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 1.17.5 - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 3.6.0 + 5.10.3 diff --git a/templates/libraries/restclient/ApiClient.mustache b/templates/libraries/restclient/ApiClient.mustache new file mode 100644 index 0000000..14b1af4 --- /dev/null +++ b/templates/libraries/restclient/ApiClient.mustache @@ -0,0 +1,756 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +{{/withXml}} +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +{{#withXml}} + import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; +{{/withXml}} +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import {{javaxPackage}}.annotation.Nullable; + +{{#jsr310}} +import java.time.OffsetDateTime; +{{/jsr310}} + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +{{>generatedAnnotation}} +public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "{{basePath}}"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + {{#openApiNullable}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + {{/openApiNullable}} + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + {{#withXml}} + XmlMapper xmlMapper = new XmlMapper(); + xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); + {{#openApiNullable}} + xmlMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} + + {{/withXml}} + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + {{#withXml}} + converters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); + {{/withXml}} + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken the access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } {{#jsr310}}else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } {{/jsr310}}else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/templates/libraries/restclient/README.mustache b/templates/libraries/restclient/README.mustache new file mode 100644 index 0000000..ec6244a --- /dev/null +++ b/templates/libraries/restclient/README.mustache @@ -0,0 +1,216 @@ +# {{artifactId}} + +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. + mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. + } + + dependencies { + implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = new ApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (HttpStatusCodeException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-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#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/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}} + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/templates/libraries/restclient/api.mustache b/templates/libraries/restclient/api.mustache new file mode 100644 index 0000000..1475fc0 --- /dev/null +++ b/templates/libraries/restclient/api.mustache @@ -0,0 +1,185 @@ +package {{package}}; + +import {{invokerPackage}}.ApiClient; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private ApiClient apiClient; + + public {{classname}}() { + this(new ApiClient()); + } + + @Autowired + public {{classname}}(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + {{#operation}} + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + private ResponseSpec {{operationId}}RequestCreation({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new RestClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + {{/required}} + {{/allParams}} + // create path and map variables + final Map pathParams = new HashMap<>(); + {{#hasPathParams}} + + {{#pathParams}} + pathParams.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), {{/collectionFormat}}{{{paramName}}}{{#collectionFormat}}){{/collectionFormat}}); + {{/pathParams}} + {{/hasPathParams}} + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + {{#hasQueryParams}} + + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + + {{#headerParams}} + if ({{paramName}} != null) + headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + {{/-last}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasCookieParams}} + + {{#cookieParams}} + cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/cookieParams}} + {{/hasCookieParams}} + {{#hasFormParams}} + + {{#formParams}} + if ({{paramName}} != null) + formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}); + {{/formParams}} + {{/hasFormParams}} + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}}}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}}}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + {{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).body(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).toEntity(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/templates/libraries/restclient/api_test.mustache b/templates/libraries/restclient/api_test.mustache new file mode 100644 index 0000000..dc34083 --- /dev/null +++ b/templates/libraries/restclient/api_test.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for {{classname}} + */ +@Ignore +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + */ + @Test + public void {{operationId}}Test() { + {{#allParams}} + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + {{/allParams}} + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + // TODO: test validations + } + {{/operation}}{{/operations}} +} \ No newline at end of file diff --git a/templates/libraries/restclient/auth/ApiKeyAuth.mustache b/templates/libraries/restclient/auth/ApiKeyAuth.mustache new file mode 100644 index 0000000..d329303 --- /dev/null +++ b/templates/libraries/restclient/auth/ApiKeyAuth.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/templates/libraries/restclient/auth/Authentication.mustache b/templates/libraries/restclient/auth/Authentication.mustache new file mode 100644 index 0000000..0636a6d --- /dev/null +++ b/templates/libraries/restclient/auth/Authentication.mustache @@ -0,0 +1,16 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/templates/libraries/restclient/auth/HttpBasicAuth.mustache b/templates/libraries/restclient/auth/HttpBasicAuth.mustache new file mode 100644 index 0000000..fba1265 --- /dev/null +++ b/templates/libraries/restclient/auth/HttpBasicAuth.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/templates/libraries/restclient/auth/HttpBearerAuth.mustache b/templates/libraries/restclient/auth/HttpBearerAuth.mustache new file mode 100644 index 0000000..ecf258a --- /dev/null +++ b/templates/libraries/restclient/auth/HttpBearerAuth.mustache @@ -0,0 +1,58 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/templates/libraries/restclient/auth/OAuth.mustache b/templates/libraries/restclient/auth/OAuth.mustache new file mode 100644 index 0000000..1e1e624 --- /dev/null +++ b/templates/libraries/restclient/auth/OAuth.mustache @@ -0,0 +1,26 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (accessToken != null) { + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); + } + } +} diff --git a/templates/libraries/restclient/auth/OAuthFlow.mustache b/templates/libraries/restclient/auth/OAuthFlow.mustache new file mode 100644 index 0000000..759f354 --- /dev/null +++ b/templates/libraries/restclient/auth/OAuthFlow.mustache @@ -0,0 +1,7 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} \ No newline at end of file diff --git a/templates/libraries/restclient/build.gradle.mustache b/templates/libraries/restclient/build.gradle.mustache new file mode 100644 index 0000000..4aec430 --- /dev/null +++ b/templates/libraries/restclient/build.gradle.mustache @@ -0,0 +1,159 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + {{#swagger1AnnotationLibrary}} + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + {{#openApiNullable}} + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + {{/openApiNullable}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + implementation "joda-time:joda-time:$jodatime_version" + {{/joda}} + {{#withXml}} + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" + {{/withXml}} + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/templates/libraries/retrofit/pom.mustache b/templates/libraries/restclient/pom.mustache similarity index 60% rename from templates/libraries/retrofit/pom.mustache rename to templates/libraries/restclient/pom.mustache index 1566db9..d3f6ab6 100644 --- a/templates/libraries/retrofit/pom.mustache +++ b/templates/libraries/restclient/pom.mustache @@ -43,7 +43,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.4.0 enforce-maven @@ -63,18 +63,27 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.1.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + true + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -95,11 +104,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -111,7 +119,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.4.0 add_sources @@ -142,30 +150,18 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.11.0 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 17 + 17 org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.5.0 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} @@ -179,7 +175,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.0 attach-sources @@ -217,79 +213,162 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} + com.google.code.findbugs jsr305 3.0.2 + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} + {{#withXml}} + + - com.squareup.retrofit - retrofit - ${retrofit-version} + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} - com.squareup.okhttp - okhttp - ${okhttp-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} joda-time joda-time ${jodatime-version} - {{#threetenbp}} + {{/joda}} + {{#useBeanValidation}} + - org.threeten - threetenbp - ${threetenbp-version} + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided - {{/threetenbp}} - {{#parcelableModel}} - + {{/useBeanValidation}} + {{#performBeanValidation}} + - com.google.android - android - 4.1.1.4 - provided + org.hibernate + hibernate-validator + ${hibernate-validator-version} - {{/parcelableModel}} + {{/performBeanValidation}} jakarta.annotation jakarta.annotation-api ${jakarta-annotation-version} provided + - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.5.21 - 1.9.0 - 2.7.5 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 6.1.6 + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{#joda}} 2.9.9 - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} - 1.0.1 - 1.3.5 - 1.0.0 - 4.13.1 + {{/joda}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 diff --git a/templates/libraries/resteasy/ApiClient.mustache b/templates/libraries/resteasy/ApiClient.mustache index 7bdb6e8..fc59766 100644 --- a/templates/libraries/resteasy/ApiClient.mustache +++ b/templates/libraries/resteasy/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.File; @@ -24,24 +26,20 @@ import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericEntity; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; import org.jboss.logging.Logger; import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration; @@ -90,8 +88,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -502,15 +500,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (param.getValue() instanceof File) { File file = (File) param.getValue(); try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getKey(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE, file.getName()); } catch (FileNotFoundException e) { throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); } } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getKey(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); } } - entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); + GenericEntity genericEntity = new GenericEntity(multipart) { }; + entity = Entity.entity(genericEntity, MediaType.MULTIPART_FORM_DATA_TYPE); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { Form form = new Form(); for (Entry param: formParams.entrySet()) { @@ -677,6 +676,38 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Entity entity = serialize(body, formParams, contentType); + try (Response response = invoke(invocationBuilder, method, entity)) { + statusCode = response.getStatusInfo().getStatusCode(); + responseHeaders = buildResponseHeaders(response); + + if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { + return null; + } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { + if (returnType == null) + return null; + else + return deserialize(response, returnType); + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), + message, + buildResponseHeaders(response), + respBody); + } + } + } + + private Response invoke(Invocation.Builder invocationBuilder, String method, Entity entity) throws ApiException { Response response = null; if ("GET".equals(method)) { @@ -699,36 +730,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new ApiException(500, "unknown method type " + method); } - statusCode = response.getStatusInfo().getStatusCode(); - responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return null; - } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { - if (returnType == null) - return null; - else - return deserialize(response, returnType); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } + return response; } - /** + /** * Build the Client used to make HTTP requests. */ private Client buildHttpClient(boolean debugging) { diff --git a/templates/libraries/resteasy/JSON.mustache b/templates/libraries/resteasy/JSON.mustache index 71bd624..b572830 100644 --- a/templates/libraries/resteasy/JSON.mustache +++ b/templates/libraries/resteasy/JSON.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; @@ -9,7 +11,7 @@ import com.fasterxml.jackson.datatype.jsr310.*; import java.text.DateFormat; -import javax.ws.rs.ext.ContextResolver; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; {{>generatedAnnotation}} public class JSON implements ContextResolver { diff --git a/templates/libraries/resteasy/api.mustache b/templates/libraries/resteasy/api.mustache index 9194b75..773fc51 100644 --- a/templates/libraries/resteasy/api.mustache +++ b/templates/libraries/resteasy/api.mustache @@ -5,17 +5,15 @@ import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Pair; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} @@ -69,10 +67,10 @@ public class {{classname}} { .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); diff --git a/templates/libraries/resteasy/build.gradle.mustache b/templates/libraries/resteasy/build.gradle.mustache index 0a801b9..de86eb0 100644 --- a/templates/libraries/resteasy/build.gradle.mustache +++ b/templates/libraries/resteasy/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -98,15 +98,16 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" - junit_version = "4.13" + assertj_version = "3.23.1" + junit_version = "5.10.2" } dependencies { @@ -124,5 +125,6 @@ dependencies { {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.assertj:assertj-core:$assertj_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/templates/libraries/resteasy/build.sbt.mustache b/templates/libraries/resteasy/build.sbt.mustache index 957990e..8ebcd90 100644 --- a/templates/libraries/resteasy/build.sbt.mustache +++ b/templates/libraries/resteasy/build.sbt.mustache @@ -13,13 +13,14 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13" % "test", + "org.assertj" % "assertj-core" % "3.23.1" % "test", + "junit" % "junit" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/templates/libraries/resteasy/pom.mustache b/templates/libraries/resteasy/pom.mustache index cf39a16..1b0dec8 100644 --- a/templates/libraries/resteasy/pom.mustache +++ b/templates/libraries/resteasy/pom.mustache @@ -61,17 +61,16 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest @@ -149,7 +148,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none 1.8 @@ -166,11 +165,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -239,6 +247,11 @@ jackson-dataformat-xml ${jackson-version} + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} @@ -264,24 +277,41 @@ - junit - junit + org.assertj + assertj-core + ${assertj-version} + test + + + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.6.3 - 4.5.11.Final - 2.10.5 - 2.10.5.1 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 4.7.6.Final + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} 2.9.10 1.0.0 - 4.13 + 3.23.1 + 5.10.2 diff --git a/templates/libraries/resttemplate/ApiClient.mustache b/templates/libraries/resttemplate/ApiClient.mustache index f868eaa..e4711ca 100644 --- a/templates/libraries/resttemplate/ApiClient.mustache +++ b/templates/libraries/resttemplate/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; {{#withXml}} @@ -31,17 +33,12 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; -{{#threetenbp}} -import org.threeten.bp.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; -import com.fasterxml.jackson.databind.ObjectMapper; -{{/threetenbp}} {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} @@ -69,9 +66,10 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -{{#jsr310}}{{^threetenbp}} +import java.util.function.Supplier; +{{#jsr310}} import java.time.OffsetDateTime; -{{/threetenbp}}{{/jsr310}} +{{/jsr310}} import {{invokerPackage}}.auth.Authentication; {{#hasHttpBasicMethods}} @@ -88,7 +86,9 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} +{{#generateClientAsBean}} @Component("{{invokerPackage}}.ApiClient") +{{/generateClientAsBean}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -109,6 +109,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private HttpHeaders defaultHeaders = new HttpHeaders(); private MultiValueMap defaultCookies = new LinkedMultiValueMap(); + private int maxAttemptsForRetry = {{maxAttemptsForRetry}}; + + private long waitTimeMillis = {{waitTimeMillis}}; + private String basePath = "{{basePath}}"; private RestTemplate restTemplate; @@ -122,7 +126,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { init(); } + {{#generateClientAsBean}} @Autowired + {{/generateClientAsBean}} public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); @@ -141,8 +147,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -169,6 +175,46 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return this; } + /** + * Get the max attempts for retry + * + * @return int the max attempts + */ + public int getMaxAttemptsForRetry() { + return maxAttemptsForRetry; + } + + /** + * Set the max attempts for retry + * + * @param maxAttemptsForRetry the max attempts for retry + * @return ApiClient this client + */ + public ApiClient setMaxAttemptsForRetry(int maxAttemptsForRetry) { + this.maxAttemptsForRetry = maxAttemptsForRetry; + return this; + } + + /** + * Get the wait time in milliseconds + * + * @return long wait time in milliseconds + */ + public long getWaitTimeMillis() { + return waitTimeMillis; + } + + /** + * Set the wait time in milliseconds + * + * @param waitTimeMillis the wait time in milliseconds + * @return ApiClient this client + */ + public ApiClient setWaitTimeMillis(long waitTimeMillis) { + this.waitTimeMillis = waitTimeMillis; + return this; + } + /** * Get authentications (key: authentication name, value: authentication). * @@ -190,14 +236,23 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#hasHttpBearerMethods}} /** - * Helper method to set token for HTTP bearer authentication. + * Helper method to set access token for the first Bearer authentication. * - * @param bearerToken the token + * @param bearerToken Bearer token */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -278,9 +333,18 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } @@ -377,14 +441,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter) { - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - mapper.setDateFormat(dateFormat); - } - } - {{/threetenbp}} return this; } @@ -623,12 +679,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -658,8 +708,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { queryBuilder.append(encodedName); if (value != null) { String templatizedKey = encodedName + valueItemCounter++; - final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); - uriParams.put(templatizedKey, encodedValue); + uriParams.put(templatizedKey, value.toString()); queryBuilder.append('=').append("{").append(templatizedKey).append("}"); } } @@ -693,7 +742,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - Map uriParams = new HashMap<>(); + Map uriParams = new HashMap<>(); uriParams.putAll(pathParams); String finalUri = path; @@ -714,7 +763,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); } - final BodyBuilder requestBuilder = RequestEntity.method(method, uri); + final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams); if (accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } @@ -729,7 +778,36 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RequestEntity requestEntity = requestBuilder.body(selectBody(body, formParams, contentType)); - ResponseEntity responseEntity = restTemplate.exchange(requestEntity, returnType); + ResponseEntity responseEntity = null; + int attempts = 0; + while (attempts < maxAttemptsForRetry) { + try { + responseEntity = restTemplate.exchange(requestEntity, returnType); + break; + } catch (HttpServerErrorException | HttpClientErrorException ex) { + if (ex instanceof HttpServerErrorException + || ((HttpClientErrorException) ex) + .getStatusCode() + .equals(HttpStatus.TOO_MANY_REQUESTS)) { + attempts++; + if (attempts < maxAttemptsForRetry) { + try { + Thread.sleep(waitTimeMillis); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } else { + throw ex; + } + } else { + throw ex; + } + } + } + + if (responseEntity == null) { + throw new RestClientException("ResponseEntity is null"); + } if (responseEntity.getStatusCode().is2xxSuccessful()) { return responseEntity; @@ -801,23 +879,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RestTemplate restTemplate = new RestTemplate(messageConverters); {{/withXml}}{{^withXml}}RestTemplate restTemplate = new RestTemplate();{{/withXml}} - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter){ - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{#openApiNullable}} - mapper.registerModule(new JsonNullableModule()); - {{/openApiNullable}} - } - } - {{/threetenbp}} // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); + restTemplate.setUriTemplateHandler(uriBuilderFactory); return restTemplate; } @@ -857,13 +925,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } private void logResponse(ClientHttpResponse response) throws IOException { - log.info("HTTP Status Code: " + response.getRawStatusCode()); + log.info("HTTP Status Code: " + response.getStatusCode().value()); log.info("Status Text: " + response.getStatusText()); log.info("HTTP Headers: " + headersToString(response.getHeaders())); log.info("Response Body: " + bodyToString(response.getBody())); } private String headersToString(HttpHeaders headers) { + if(headers == null || headers.isEmpty()) { + return ""; + } StringBuilder builder = new StringBuilder(); for (Entry> entry : headers.entrySet()) { builder.append(entry.getKey()).append("=["); diff --git a/templates/libraries/resttemplate/BaseApi.mustache b/templates/libraries/resttemplate/BaseApi.mustache new file mode 100644 index 0000000..3b47979 --- /dev/null +++ b/templates/libraries/resttemplate/BaseApi.mustache @@ -0,0 +1,76 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import org.springframework.web.client.RestClientException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(new ApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method) throws RestClientException { + return invokeAPI(url, method, null, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request) throws RestClientException { + return invokeAPI(url, method, request, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, ParameterizedTypeReference returnType) throws RestClientException { + return invokeAPI(url, method, null, returnType); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public abstract ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException; +} diff --git a/templates/libraries/resttemplate/api.mustache b/templates/libraries/resttemplate/api.mustache index cc207bd..aa1a98f 100644 --- a/templates/libraries/resttemplate/api.mustache +++ b/templates/libraries/resttemplate/api.mustache @@ -1,17 +1,23 @@ package {{package}}; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.BaseApi; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}}import java.util.Collections; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.stream.Collectors;{{/fullJavaUtil}} +import java.util.stream.Collectors; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; @@ -27,26 +33,21 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; {{>generatedAnnotation}} +{{#generateClientAsBean}} @Component("{{package}}.{{classname}}") +{{/generateClientAsBean}} {{#operations}} -public class {{classname}} { - private ApiClient apiClient; +public class {{classname}} extends BaseApi { public {{classname}}() { - this(new ApiClient()); + super(new ApiClient()); } + {{#generateClientAsBean}} @Autowired + {{/generateClientAsBean}} public {{classname}}(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + super(apiClient); } {{#operation}} @@ -74,7 +75,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody(); {{/returnType}} @@ -105,8 +106,8 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { - Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + public ResponseEntity<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { @@ -117,40 +118,71 @@ public class {{classname}} { final Map uriVariables = new HashMap();{{#pathParams}} uriVariables.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()), {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}});{{/pathParams}}{{/hasPathParams}} - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap();{{#hasQueryParams}} - {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} - {{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + {{#queryParams}}{{#isExplode}}{{#hasVars}} + if ({{paramName}} != null) { + {{#vars}} localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}}{{/hasVars}}{{^hasVars}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}}if ({{paramName}} != null) - headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarHeaderParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/headerParams}}{{/hasHeaderParams}}{{#hasCookieParams}} {{#cookieParams}}if ({{paramName}} != null) - cookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarCookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} + localVarFormParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} {{/-last}}{{/formParams}}{{/hasFormParams}} final String[] localVarAccepts = { {{#hasProduces}} {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} {{/hasProduces}} }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { {{#hasConsumes}} + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}} }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}> localReturnType = new ParameterizedTypeReference<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } + {{#-last}} + + @Override + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { + String localVarPath = url.replace(apiClient.getBasePath(), ""); + Object localVarPostBody = request; + + final Map uriVariables = new HashMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}} }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} {{/hasConsumes}} }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};{{/returnType}} - return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + return apiClient.invokeAPI(localVarPath, method, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, returnType); } + {{/-last}} {{/operation}} } {{/operations}} diff --git a/templates/libraries/resttemplate/api_test.mustache b/templates/libraries/resttemplate/api_test.mustache index 865572a..04a19f1 100644 --- a/templates/libraries/resttemplate/api_test.mustache +++ b/templates/libraries/resttemplate/api_test.mustache @@ -4,21 +4,27 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.web.client.RestClientException; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore -public class {{classname}}Test { +@Disabled +class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -28,15 +34,16 @@ public class {{classname}}Test { * * {{notes}} * - * @throws ApiException + * @throws RestClientException * if the Api call fails */ @Test - public void {{operationId}}Test() { + void {{operationId}}Test() { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache b/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache index 857403b..d329303 100644 --- a/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache +++ b/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/templates/libraries/resttemplate/auth/Authentication.mustache b/templates/libraries/resttemplate/auth/Authentication.mustache index 8e53c2b..0636a6d 100644 --- a/templates/libraries/resttemplate/auth/Authentication.mustache +++ b/templates/libraries/resttemplate/auth/Authentication.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache b/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache index 5b07cb9..fba1265 100644 --- a/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache +++ b/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache @@ -1,10 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +35,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache b/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache index 1d1610c..ecf258a 100644 --- a/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache +++ b/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache @@ -1,31 +1,51 @@ -package {{invokerPackage}}.auth; +{{>licenseInfo}} -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; +package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; } + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/templates/libraries/resttemplate/auth/OAuth.mustache b/templates/libraries/resttemplate/auth/OAuth.mustache index 7889f15..1e82042 100644 --- a/templates/libraries/resttemplate/auth/OAuth.mustache +++ b/templates/libraries/resttemplate/auth/OAuth.mustache @@ -1,24 +1,50 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ {{>generatedAnnotation}} public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } diff --git a/templates/libraries/resttemplate/auth/OAuthFlow.mustache b/templates/libraries/resttemplate/auth/OAuthFlow.mustache index 7ab35f6..759f354 100644 --- a/templates/libraries/resttemplate/auth/OAuthFlow.mustache +++ b/templates/libraries/resttemplate/auth/OAuthFlow.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; public enum OAuthFlow { diff --git a/templates/libraries/resttemplate/build.gradle.mustache b/templates/libraries/resttemplate/build.gradle.mustache index 75b4478..a900fc8 100644 --- a/templates/libraries/resttemplate/build.gradle.mustache +++ b/templates/libraries/resttemplate/build.gradle.mustache @@ -32,14 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} } // Rename the aar correctly @@ -63,16 +63,16 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -84,14 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} publishing { publications { @@ -103,29 +103,42 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} + {{#useJakartaEe}} + spring_web_version = "6.1.5" + jakarta_annotation_version = "2.1.1" + {{/useJakartaEe}} + {{^useJakartaEe}} + spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" - spring_web_version = "5.2.5.RELEASE" + {{/useJakartaEe}} jodatime_version = "2.9.9" - junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.10.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" @@ -136,19 +149,29 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + } diff --git a/templates/libraries/resttemplate/pom.mustache b/templates/libraries/resttemplate/pom.mustache index 6bd5637..250417d 100644 --- a/templates/libraries/resttemplate/pom.mustache +++ b/templates/libraries/resttemplate/pom.mustache @@ -43,7 +43,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.4.0 enforce-maven @@ -63,18 +63,27 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.1.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + true + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -95,11 +104,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -111,7 +119,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.4.0 add_sources @@ -142,22 +150,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.11.0 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + {{#useJakartaEe}} + 17 + 17 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.8 + 1.8 + {{/useJakartaEe}} org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.5.0 none @@ -173,7 +181,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.0 attach-sources @@ -211,11 +219,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -252,52 +269,75 @@ jackson-databind ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} + {{#openApiNullable}} org.openapitools jackson-databind-nullable ${jackson-databind-nullable-version} + {{/openApiNullable}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + ${hibernate-validator-version} + + {{/performBeanValidation}} jakarta.annotation jakarta.annotation-api @@ -307,27 +347,53 @@ - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.5.22 - 5.2.5.RELEASE - 2.10.5 - 2.10.5.1 - 0.2.2 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + {{#useJakartaEe}} + 6.1.5 + {{/useJakartaEe}} + {{^useJakartaEe}} + 5.3.33 + {{/useJakartaEe}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 1.0.0 - 4.13.1 + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 diff --git a/templates/libraries/retrofit/ApiClient.mustache b/templates/libraries/retrofit/ApiClient.mustache deleted file mode 100644 index ad3057e..0000000 --- a/templates/libraries/retrofit/ApiClient.mustache +++ /dev/null @@ -1,448 +0,0 @@ -package {{invokerPackage}}; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Type; -import java.util.LinkedHashMap; -import java.util.Map; - -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -{{/hasOAuthMethods}} - -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import retrofit.RestAdapter; -import retrofit.client.OkClient; -import retrofit.converter.ConversionException; -import retrofit.converter.Converter; -import retrofit.converter.GsonConverter; -import retrofit.mime.TypedByteArray; -import retrofit.mime.TypedInput; -import retrofit.mime.TypedOutput; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; - -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.OAuth.AccessTokenListener; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -public class ApiClient { - - private Map apiAuthorizations; - private OkHttpClient okClient; - private RestAdapter.Builder adapterBuilder; - - public ApiClient() { - apiAuthorizations = new LinkedHashMap(); - createDefaultAdapter(); - } - - public ApiClient(String[] authNames) { - this(); - for(String authName : authNames) { - {{#hasAuthMethods}} - Interceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}} - {{#isBasicBasic}} - auth = new HttpBasicAuth(); - {{/isBasicBasic}} - {{^isBasicBasic}} - auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} - {{/isBasic}} - {{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); - {{/isApiKey}} - {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); - {{/isOAuth}} - } else {{/authMethods}}{ - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - } - addAuthorization(authName, auth); - {{/hasAuthMethods}} - {{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - {{/hasAuthMethods}} - } - } - - /** - * Basic constructor for single auth name - * @param authName Authentication name - */ - public ApiClient(String authName) { - this(new String[]{authName}); - } - - /** - * Helper constructor for single api key - * @param authName Authentication name - * @param apiKey API key - */ - public ApiClient(String authName, String apiKey) { - this(authName); - this.setApiKey(apiKey); - } - - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName Authentication name - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - {{#hasOAuthMethods}} - /** - * Helper constructor for single password oauth2 - * @param authName Authentication name - * @param clientId Client ID - * @param secret Client secret - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - - {{/hasOAuthMethods}} - public void createDefaultAdapter() { - Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) - .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) - .create(); - - okClient = new OkHttpClient(); - - adapterBuilder = new RestAdapter - .Builder() - .setEndpoint("{{{basePath}}}") - .setClient(new OkClient(okClient)) - .setConverter(new GsonConverterWrapper(gson)); - } - - public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); - - } - - /** - * Helper method to configure the first api key found - * @param apiKey API key - */ - private void setApiKey(String apiKey) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return; - } - } - } - - /** - * Helper method to set token for the first Http Bearer authentication found. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - } - - /** - * Helper method to configure the username/password for basic auth or password oauth - * @param username Username - * @param password Password - */ - private void setCredentials(String username, String password) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - {{#hasOAuthMethods}} - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - {{/hasOAuthMethods}} - } - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken); - return; - } - } - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - */ - public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - */ - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } - } - {{/hasOAuthMethods}} - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization - */ - public void addAuthorization(String authName, Interceptor authorization) { - if (apiAuthorizations.containsKey(authName)) { - throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); - } - apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); - } - - public Map getApiAuthorizations() { - return apiAuthorizations; - } - - public void setApiAuthorizations(Map apiAuthorizations) { - this.apiAuthorizations = apiAuthorizations; - } - - public RestAdapter.Builder getAdapterBuilder() { - return adapterBuilder; - } - - public void setAdapterBuilder(RestAdapter.Builder adapterBuilder) { - this.adapterBuilder = adapterBuilder; - } - - public OkHttpClient getOkClient() { - return okClient; - } - - public void addAuthsToOkClient(OkHttpClient okClient) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); - } - } - - /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the RestAdapter - * @param okClient OkHttp client - */ - public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.clone(); - addAuthsToOkClient(clone); - adapterBuilder.setClient(new OkClient(clone)); - } -} - -/** - * This wrapper is to take care of this case: - * when the deserialization fails due to JsonParseException and the - * expected type is String, then just return the body string. - */ -class GsonConverterWrapper implements Converter { - private GsonConverter converter; - - public GsonConverterWrapper(Gson gson) { - converter = new GsonConverter(gson); - } - - @Override public Object fromBody(TypedInput body, Type type) throws ConversionException { - byte[] bodyBytes = readInBytes(body); - TypedByteArray newBody = new TypedByteArray(body.mimeType(), bodyBytes); - try { - return converter.fromBody(newBody, type); - } catch (ConversionException e) { - if (e.getCause() instanceof JsonParseException && type.equals(String.class)) { - return new String(bodyBytes); - } else { - throw e; - } - } - } - - @Override public TypedOutput toBody(Object object) { - return converter.toBody(object); - } - - private byte[] readInBytes(TypedInput body) throws ConversionException { - InputStream in = null; - try { - in = body.in(); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - byte[] buffer = new byte[0xFFFF]; - for (int len; (len = in.read(buffer)) != -1;) - os.write(buffer, 0, len); - os.flush(); - return os.toByteArray(); - } catch (IOException e) { - throw new ConversionException(e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException ignored) { - } - } - } - - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class DateTimeTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser(); - private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime(); - - @Override - public void write(JsonWriter out, DateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(printFormatter.print(date)); - } - } - - @Override - public DateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return parseFormatter.parseDateTime(date); - } - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class LocalDateTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter formatter = ISODateTimeFormat.date(); - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseLocalDate(date); - } - } -} diff --git a/templates/libraries/retrofit/CollectionFormats.mustache b/templates/libraries/retrofit/CollectionFormats.mustache deleted file mode 100644 index dbfa4ae..0000000 --- a/templates/libraries/retrofit/CollectionFormats.mustache +++ /dev/null @@ -1,99 +0,0 @@ -package {{invokerPackage}}; - -import java.util.Arrays; -import java.util.List; - -public class CollectionFormats { - - public static class CSVParams { - - protected List params; - - public CSVParams() { - } - - public CSVParams(List params) { - this.params = params; - } - - public CSVParams(String... params) { - this.params = Arrays.asList(params); - } - - public List getParams() { - return params; - } - - public void setParams(List params) { - this.params = params; - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), ","); - } - - } - - public static class SPACEParams extends SSVParams { - - } - - public static class SSVParams extends CSVParams { - - public SSVParams() { - } - - public SSVParams(List params) { - super(params); - } - - public SSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), " "); - } - } - - public static class TSVParams extends CSVParams { - - public TSVParams() { - } - - public TSVParams(List params) { - super(params); - } - - public TSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join( params.toArray(new String[0]), "\t"); - } - } - - public static class PIPESParams extends CSVParams { - - public PIPESParams() { - } - - public PIPESParams(List params) { - super(params); - } - - public PIPESParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), "|"); - } - } - -} diff --git a/templates/libraries/retrofit/README.mustache b/templates/libraries/retrofit/README.mustache deleted file mode 100644 index c987758..0000000 --- a/templates/libraries/retrofit/README.mustache +++ /dev/null @@ -1,42 +0,0 @@ -# {{artifactId}} - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation & Usage - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*: - -```xml - - {{groupId}} - {{artifactId}} - {{artifactVersion}} - compile - - -``` - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/templates/libraries/retrofit/api.mustache b/templates/libraries/retrofit/api.mustache deleted file mode 100644 index 79e4ff1..0000000 --- a/templates/libraries/retrofit/api.mustache +++ /dev/null @@ -1,74 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.CollectionFormats.*; - -import retrofit.Callback; -import retrofit.http.*; -import retrofit.mime.*; - -{{#imports}}import {{import}}; -{{/imports}} - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - -{{#operations}} -public interface {{classname}} { - {{#operation}} - /** - * {{summary}} - * Sync method - * {{notes}} -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @return {{returnType}}{{^returnType}}Void{{/returnType}} -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - {{{returnType}}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}} - );{{/-last}}{{/allParams}} - - /** - * {{summary}} - * Async method -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @param cb callback method -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - void {{operationId}}( - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> cb - ); - {{/operation}} -} -{{/operations}} diff --git a/templates/libraries/retrofit/api_test.mustache b/templates/libraries/retrofit/api_test.mustache deleted file mode 100644 index 112d7f7..0000000 --- a/templates/libraries/retrofit/api_test.mustache +++ /dev/null @@ -1,44 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.ApiClient; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Before; -import org.junit.Test; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -public class {{classname}}Test { - - private {{classname}} api; - - @Before - public void setup() { - api = new ApiClient().createService({{classname}}.class); - } - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - */ - @Test - public void {{operationId}}Test() { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/templates/libraries/retrofit/auth/ApiKeyAuth.mustache b/templates/libraries/retrofit/auth/ApiKeyAuth.mustache deleted file mode 100644 index 69205bb..0000000 --- a/templates/libraries/retrofit/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,72 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class ApiKeyAuth implements Interceptor { - private final String location; - private final String paramName; - - private String apiKey; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - @Override - public Response intercept(Chain chain) throws IOException { - String paramValue; - Request request = chain.request(); - - if ("query".equals(location)) { - String newQuery = request.uri().getQuery(); - paramValue = paramName + "=" + apiKey; - if (newQuery == null) { - newQuery = paramValue; - } else { - newQuery += "&" + paramValue; - } - - URI newUri; - try { - newUri = new URI(request.uri().getScheme(), request.uri().getAuthority(), - request.uri().getPath(), newQuery, request.uri().getFragment()); - } catch (URISyntaxException e) { - throw new IOException(e); - } - - request = request.newBuilder().url(newUri.toURL()).build(); - } else if ("header".equals(location)) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build(); - } else if ("cookie".equals(location)) { - request = request.newBuilder() - .addHeader("Cookie", String.format("%s=%s", paramName, apiKey)) - .build(); - } - return chain.proceed(request); - } -} diff --git a/templates/libraries/retrofit/auth/HttpBasicAuth.mustache b/templates/libraries/retrofit/auth/HttpBasicAuth.mustache deleted file mode 100644 index cf82b27..0000000 --- a/templates/libraries/retrofit/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,49 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Credentials; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBasicAuth implements Interceptor { - - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setCredentials(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null) { - String credentials = Credentials.basic(username, password); - request = request.newBuilder() - .addHeader("Authorization", credentials) - .build(); - } - return chain.proceed(request); - } -} diff --git a/templates/libraries/retrofit/auth/HttpBearerAuth.mustache b/templates/libraries/retrofit/auth/HttpBearerAuth.mustache deleted file mode 100644 index 9b910c4..0000000 --- a/templates/libraries/retrofit/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,42 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBearerAuth implements Interceptor { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - public String getBearerToken() { - return bearerToken; - } - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null && bearerToken != null) { - request = request.newBuilder() - .addHeader("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken) - .build(); - } - return chain.proceed(request); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } - -} diff --git a/templates/libraries/retrofit/auth/OAuth.mustache b/templates/libraries/retrofit/auth/OAuth.mustache deleted file mode 100644 index 57bfd3d..0000000 --- a/templates/libraries/retrofit/auth/OAuth.mustache +++ /dev/null @@ -1,185 +0,0 @@ -package {{invokerPackage}}.auth; - -import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; -import static java.net.HttpURLConnection.HTTP_FORBIDDEN; - -import java.io.IOException; -import java.util.Map; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; -import org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Request.Builder; -import com.squareup.okhttp.Response; - -public class OAuth implements Interceptor { - - public interface AccessTokenListener { - public void notify(BasicOAuthToken token); - } - - private volatile String accessToken; - private OAuthClient oauthClient; - - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - - private AccessTokenListener accessTokenListener; - - public OAuth( OkHttpClient client, TokenRequestBuilder requestBuilder ) { - this.oauthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = requestBuilder; - } - - public OAuth(TokenRequestBuilder requestBuilder ) { - this(new OkHttpClient(), requestBuilder); - } - - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - case implicit: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) - throws IOException { - - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // If first time, get the token - OAuthClientRequest oAuthRequest; - if (getAccessToken() == null) { - updateAccessToken(null); - } - - if (getAccessToken() != null) { - // Build the request - Builder rb = request.newBuilder(); - - String requestAccessToken = new String(getAccessToken()); - try { - oAuthRequest = new OAuthBearerClientRequest(request.urlString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - for ( Map.Entry header : oAuthRequest.getHeaders().entrySet() ) { - rb.addHeader(header.getKey(), header.getValue()); - } - rb.url( oAuthRequest.getLocationUri()); - - //Execute the request - Response response = chain.proceed(rb.build()); - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept( chain, false ); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } else { - return chain.proceed(chain.request()); - } - } - - /* - * Returns true if the access token has been updated - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - return !getAccessToken().equals(requestAccessToken); - } else { - return false; - } - } catch (OAuthSystemException e) { - throw new IOException(e); - } catch (OAuthProblemException e) { - throw new IOException(e); - } - } - return true; - } - - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } - - public synchronized String getAccessToken() { - return accessToken; - } - - public synchronized void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - -} diff --git a/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache b/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index 48fc7ea..0000000 --- a/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,69 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; - - -public class OAuthOkHttpClient implements HttpClient { - - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - public void shutdown() { - // Nothing to do here - } - -} diff --git a/templates/libraries/retrofit/bodyParams.mustache b/templates/libraries/retrofit/bodyParams.mustache deleted file mode 100644 index 81de324..0000000 --- a/templates/libraries/retrofit/bodyParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/templates/libraries/retrofit/build.gradle.mustache b/templates/libraries/retrofit/build.gradle.mustache deleted file mode 100644 index 1266cde..0000000 --- a/templates/libraries/retrofit/build.gradle.mustache +++ /dev/null @@ -1,130 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } -} - -repositories { - mavenCentral() -} - - -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - {{#java8}} - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - okhttp_version = "2.7.5" - oltu_version = "1.0.1" - retrofit_version = "1.9.0" - swagger_annotations_version = "1.5.21" - jakarta_annotation_version = "1.3.5" - junit_version = "4.13.1" - jodatime_version = "2.9.3" - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} -} - -dependencies { - implementation "com.squareup.okhttp:okhttp:$okhttp_version" - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "com.squareup.retrofit:retrofit:$retrofit_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" - implementation "joda-time:joda-time:$jodatime_version" - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" -} diff --git a/templates/libraries/retrofit/build.sbt.mustache b/templates/libraries/retrofit/build.sbt.mustache deleted file mode 100644 index b279317..0000000 --- a/templates/libraries/retrofit/build.sbt.mustache +++ /dev/null @@ -1,24 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "com.squareup.okhttp" % "okhttp" % "2.7.5" % "compile", - "com.squareup.retrofit" % "retrofit" % "1.9.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "joda-time" % "joda-time" % "2.9.3" % "compile", - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/templates/libraries/retrofit/formParams.mustache b/templates/libraries/retrofit/formParams.mustache deleted file mode 100644 index 851072b..0000000 --- a/templates/libraries/retrofit/formParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/templates/libraries/retrofit/headerParams.mustache b/templates/libraries/retrofit/headerParams.mustache deleted file mode 100644 index 5d6da4a..0000000 --- a/templates/libraries/retrofit/headerParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/templates/libraries/retrofit/pathParams.mustache b/templates/libraries/retrofit/pathParams.mustache deleted file mode 100644 index 7b8be84..0000000 --- a/templates/libraries/retrofit/pathParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/templates/libraries/retrofit/queryParams.mustache b/templates/libraries/retrofit/queryParams.mustache deleted file mode 100644 index 2a580ab..0000000 --- a/templates/libraries/retrofit/queryParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/templates/libraries/retrofit2/ApiClient.mustache b/templates/libraries/retrofit2/ApiClient.mustache index 57c9772..077e8d6 100644 --- a/templates/libraries/retrofit2/ApiClient.mustache +++ b/templates/libraries/retrofit2/ApiClient.mustache @@ -1,8 +1,12 @@ +{{>licenseInfo}} + package {{invokerPackage}}; +{{#gson}} import com.google.gson.Gson; import com.google.gson.JsonParseException; import com.google.gson.JsonElement; +{{/gson}} import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.RequestBody; @@ -14,18 +18,20 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil {{#joda}} import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} import retrofit2.Converter; import retrofit2.Retrofit; {{#useRxJava2}} import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; {{/useRxJava2}} {{#useRxJava3}} -import hu.akarnokd.rxjava3.retrofit.RxJava3CallAdapterFactory; +import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory; {{/useRxJava3}} +{{#gson}} import retrofit2.converter.gson.GsonConverterFactory; +{{/gson}} +{{#jackson}} +import retrofit2.converter.jackson.JacksonConverterFactory; +{{/jackson}} import retrofit2.converter.scalars.ScalarsConverterFactory; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; @@ -40,9 +46,7 @@ import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; -{{#java8}} import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; @@ -71,24 +75,25 @@ public class ApiClient { this(); for(String authName : authNames) { {{#hasAuthMethods}} - Interceptor auth; + Interceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}}{{#isBasicBasic}} + {{#isBasicBasic}} auth = new HttpBasicAuth(); - {{/isBasicBasic}}{{^isBasicBasic}} + {{/isBasicBasic}}{{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}}{{/isBasic}} + {{/isBasicBearer}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = new OAuth(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - - addAuthorization(authName, auth); + if (auth != null) { + addAuthorization(authName, auth); + } {{/hasAuthMethods}} {{^hasAuthMethods}} throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -161,7 +166,12 @@ public class ApiClient { .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) {{/useRxJava3}} .addConverterFactory(ScalarsConverterFactory.create()) + {{#jackson}} + .addConverterFactory(JacksonConverterFactory.create(json.getMapper())); + {{/jackson}} + {{#gson}} .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); + {{/gson}} } public S createService(Class serviceClass) { @@ -177,6 +187,7 @@ public class ApiClient { return this; } + {{#gson}} public ApiClient setSqlDateFormat(DateFormat dateFormat) { this.json.setSqlDateFormat(dateFormat); return this; @@ -204,8 +215,9 @@ public class ApiClient { this.json.setLocalDateFormat(dateFormat); return this; } - {{/jsr310}} + {{/gson}} + /** * Helper method to configure the first api key found @@ -405,6 +417,7 @@ public class ApiClient { } } +{{#gson}} /** * This wrapper is to take care of this case: * when the deserialization fails due to JsonParseException and the @@ -459,3 +472,4 @@ class GsonCustomConverterFactory extends Converter.Factory return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit); } } +{{/gson}} \ No newline at end of file diff --git a/templates/libraries/retrofit2/CollectionFormats.mustache b/templates/libraries/retrofit2/CollectionFormats.mustache index dbfa4ae..d63c8a8 100644 --- a/templates/libraries/retrofit2/CollectionFormats.mustache +++ b/templates/libraries/retrofit2/CollectionFormats.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Arrays; diff --git a/templates/libraries/retrofit2/JSON.mustache b/templates/libraries/retrofit2/JSON.mustache index 9ba7567..2ff8b1c 100644 --- a/templates/libraries/retrofit2/JSON.mustache +++ b/templates/libraries/retrofit2/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -35,11 +30,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/templates/libraries/retrofit2/JSON_jackson.mustache b/templates/libraries/retrofit2/JSON_jackson.mustache new file mode 100644 index 0000000..525fe5d --- /dev/null +++ b/templates/libraries/retrofit2/JSON_jackson.mustache @@ -0,0 +1,263 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} +{{#models.0}} +import {{modelPackage}}.*; +{{/models.0}} + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; + +{{>generatedAnnotation}} +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static + { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/templates/libraries/retrofit2/api.mustache b/templates/libraries/retrofit2/api.mustache index 82c3fe0..dd521a5 100644 --- a/templates/libraries/retrofit2/api.mustache +++ b/templates/libraries/retrofit2/api.mustache @@ -28,13 +28,17 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +import java.util.Set; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{#operations}} public interface {{classname}} { {{#operation}} diff --git a/templates/libraries/retrofit2/api_test.mustache b/templates/libraries/retrofit2/api_test.mustache index 3f60dd1..dab62f3 100644 --- a/templates/libraries/retrofit2/api_test.mustache +++ b/templates/libraries/retrofit2/api_test.mustache @@ -3,16 +3,22 @@ package {{package}}; import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ @@ -20,7 +26,7 @@ public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService({{classname}}.class); } diff --git a/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache b/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache index bcc62b2..d87c2e4 100644 --- a/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache +++ b/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache b/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache index 9bd756e..ac03476 100644 --- a/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache +++ b/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache b/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache index da1bef5..764c8f2 100644 --- a/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache +++ b/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/templates/libraries/retrofit2/auth/OAuth.mustache b/templates/libraries/retrofit2/auth/OAuth.mustache index 88e4e62..6ea77b7 100644 --- a/templates/libraries/retrofit2/auth/OAuth.mustache +++ b/templates/libraries/retrofit2/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; @@ -54,14 +56,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache b/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache index a499c7b..5fe0131 100644 --- a/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache +++ b/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/templates/libraries/retrofit2/build.gradle.mustache b/templates/libraries/retrofit2/build.gradle.mustache index a5c716b..407e97a 100644 --- a/templates/libraries/retrofit2/build.gradle.mustache +++ b/templates/libraries/retrofit2/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -110,18 +98,21 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" + retrofit_version = "2.11.0" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + javax_ws_rs_api_version = "2.1.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + {{/jackson}} {{#usePlayWS}} - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" - {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" - {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" play_version = "2.6.7" {{/usePlayWS}} + jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.1" + junit_version = "5.10.3" {{#useRxJava2}} rx_java_version = "2.1.1" {{/useRxJava2}} @@ -131,10 +122,7 @@ ext { {{#joda}} jodatime_version = "2.9.9" {{/joda}} - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} - json_fire_version = "1.8.0" + json_fire_version = "1.9.0" } dependencies { @@ -146,7 +134,7 @@ dependencies { implementation "io.reactivex.rxjava2:rxjava:$rx_java_version" {{/useRxJava2}} {{#useRxJava3}} - implementation 'com.github.akarnokd:rxjava3-retrofit-adapter:3.0.0' + implementation 'com.squareup.retrofit2:adapter-rxjava3:$$retrofit_version' implementation "io.reactivex.rxjava3:rxjava:$rx_java_version" {{/useRxJava3}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" @@ -158,21 +146,21 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} {{#usePlayWS}} implementation "com.typesafe.play:play-ahc-ws_2.12:$play_version" - implementation "jakarta.validation:jakarta.validation-api:2.0.2" + {{/usePlayWS}} + {{#jackson}} + implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "com.squareup.retrofit2:converter-jackson:$retrofit_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "javax.ws.rs:javax.ws.rs-api:$javax_ws_rs_api_version" {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}:$jackson_version" - {{/usePlayWS}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/templates/libraries/retrofit2/build.sbt.mustache b/templates/libraries/retrofit2/build.sbt.mustache index a572f4b..03b8653 100644 --- a/templates/libraries/retrofit2/build.sbt.mustache +++ b/templates/libraries/retrofit2/build.sbt.mustache @@ -9,25 +9,25 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.11.0" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.11.0" % "compile", {{^usePlayWS}} - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.11.0" % "compile", {{/usePlayWS}} {{#usePlayWS}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", - "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", - "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", + "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", + "com.squareup.retrofit2" % "converter-jackson" % "2.11.0" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{/usePlayWS}} {{#useRxJava2}} - "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "adapter-rxjava2" % "2.11.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", {{/useRxJava2}} {{#useRxJava3}} - "com.github.akarnokd" % "rxjava3-retrofit-adapter" % "3.0.0" % "compile", + "com.squareup.retrofit2" % "adapter-rxjava3" % "2.11.0" % "compile", "io.reactivex.rxjava3" % "rxjava" % "3.0.4" % "compile", {{/useRxJava3}} "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", @@ -35,12 +35,9 @@ lazy val root = (project in file(".")). {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/templates/libraries/retrofit2/play24/ApiClient.mustache b/templates/libraries/retrofit2/play24/ApiClient.mustache index c43f800..78e3f85 100644 --- a/templates/libraries/retrofit2/play24/ApiClient.mustache +++ b/templates/libraries/retrofit2/play24/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.IOException; @@ -45,8 +47,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache b/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache index d9ed333..d6411f2 100644 --- a/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache +++ b/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import play.libs.F; diff --git a/templates/libraries/retrofit2/play24/Play24CallFactory.mustache b/templates/libraries/retrofit2/play24/Play24CallFactory.mustache index b17ac64..2808f26 100644 --- a/templates/libraries/retrofit2/play24/Play24CallFactory.mustache +++ b/templates/libraries/retrofit2/play24/Play24CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/templates/libraries/retrofit2/play24/api.mustache b/templates/libraries/retrofit2/play24/api.mustache index 2b7512d..f793699 100644 --- a/templates/libraries/retrofit2/play24/api.mustache +++ b/templates/libraries/retrofit2/play24/api.mustache @@ -14,12 +14,10 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import play.libs.F; import retrofit2.Response; diff --git a/templates/libraries/retrofit2/play25/ApiClient.mustache b/templates/libraries/retrofit2/play25/ApiClient.mustache index 849e066..22d48bd 100644 --- a/templates/libraries/retrofit2/play25/ApiClient.mustache +++ b/templates/libraries/retrofit2/play25/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.IOException; @@ -44,8 +46,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"query"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache b/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache index 62360bf..b431690 100644 --- a/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache +++ b/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.concurrent.CompletionStage; diff --git a/templates/libraries/retrofit2/play25/Play25CallFactory.mustache b/templates/libraries/retrofit2/play25/Play25CallFactory.mustache index a9f1947..d7d27d2 100644 --- a/templates/libraries/retrofit2/play25/Play25CallFactory.mustache +++ b/templates/libraries/retrofit2/play25/Play25CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/templates/libraries/retrofit2/play25/api.mustache b/templates/libraries/retrofit2/play25/api.mustache index d4e97cc..de6a6f6 100644 --- a/templates/libraries/retrofit2/play25/api.mustache +++ b/templates/libraries/retrofit2/play25/api.mustache @@ -14,12 +14,10 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import java.util.concurrent.*; import retrofit2.Response; diff --git a/templates/libraries/retrofit2/play26/ApiClient.mustache b/templates/libraries/retrofit2/play26/ApiClient.mustache index b752b43..ef1b75d 100644 --- a/templates/libraries/retrofit2/play26/ApiClient.mustache +++ b/templates/libraries/retrofit2/play26/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.File; @@ -59,8 +61,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache b/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache index 05c7254..2b7739f 100644 --- a/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache +++ b/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.concurrent.CompletionStage; diff --git a/templates/libraries/retrofit2/play26/Play26CallFactory.mustache b/templates/libraries/retrofit2/play26/Play26CallFactory.mustache index f65c921..c309dee 100644 --- a/templates/libraries/retrofit2/play26/Play26CallFactory.mustache +++ b/templates/libraries/retrofit2/play26/Play26CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/templates/libraries/retrofit2/play26/api.mustache b/templates/libraries/retrofit2/play26/api.mustache index dd3339f..e78bd98 100644 --- a/templates/libraries/retrofit2/play26/api.mustache +++ b/templates/libraries/retrofit2/play26/api.mustache @@ -17,12 +17,15 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import java.util.concurrent.*; import retrofit2.Response; diff --git a/templates/libraries/retrofit2/pom.mustache b/templates/libraries/retrofit2/pom.mustache index 5c00061..b02a5fb 100644 --- a/templates/libraries/retrofit2/pom.mustache +++ b/templates/libraries/retrofit2/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -144,28 +144,17 @@ maven-compiler-plugin 3.6.1 - {{#java8}} 1.8 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -228,11 +217,13 @@ jsr305 3.0.2 + {{#gson}} com.squareup.retrofit2 converter-gson ${retrofit-version} + {{/gson}} com.squareup.retrofit2 retrofit @@ -254,11 +245,13 @@ + {{#gson}} io.gsonfire gson-fire ${gson-fire-version} + {{/gson}} {{#joda}} joda-time @@ -266,13 +259,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#useRxJava2}} io.reactivex.rxjava2 @@ -292,12 +278,12 @@ ${rxjava-version} - com.github.akarnokd - rxjava3-retrofit-adapter - 3.0.0 + com.squareup.retrofit2 + adapter-rxjava3 + ${retrofit-version} {{/useRxJava3}} - {{#usePlayWS}} + {{#jackson}} com.squareup.retrofit2 @@ -317,7 +303,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} {{#openApiNullable}} @@ -328,7 +314,7 @@ {{/openApiNullable}} com.fasterxml.jackson.datatype - jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}} + jackson-datatype-jsr310 ${jackson-version} {{#withXml}} @@ -339,6 +325,20 @@ ${jackson-version} {{/withXml}} + {{#useBeanValidation}} + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + + {{/useBeanValidation}} + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + {{/jackson}} + {{#usePlayWS}} com.typesafe.play play-ahc-ws_2.12 @@ -367,27 +367,33 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} - 1.8.3 + {{#gson}} + 1.9.0 + {{/gson}} 1.6.3 + {{#jackson}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{/jackson}} {{#usePlayWS}} - 2.12.1 2.6.7 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} {{/usePlayWS}} - 2.5.0 + 2.11.0 {{#useRxJava2}} 2.1.1 {{/useRxJava2}} @@ -397,14 +403,16 @@ {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} 1.0.1 - 4.13.1 + 5.10.3 diff --git a/templates/libraries/vertx/ApiClient.mustache b/templates/libraries/vertx/ApiClient.mustache index b3668e9..6607107 100644 --- a/templates/libraries/vertx/ApiClient.mustache +++ b/templates/libraries/vertx/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{invokerPackage}}.auth.Authentication; @@ -34,12 +36,7 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.text.DateFormat; import java.util.*; @@ -98,8 +95,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). this.authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -685,54 +682,54 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private final Map authentications = new LinkedHashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String username, String password) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String username, String password) { HttpBasicAuth auth = new HttpBasicAuth(); auth.setUsername(username); auth.setPassword(password); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { HttpBearerAuth auth = new HttpBearerAuth("{{scheme}}"); auth.setBearerToken(bearerToken); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}},"{{keyParamName}}"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("{{name}}", auth); }{{/isApiKey}}{{#isOAuth}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { OAuth auth = new OAuth(); auth.setAccessToken(accessToken); authentications.put("{{name}}", auth); }{{/isOAuth}}{{/authMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}(String username, String password) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}(String username, String password) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(username, password); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(username, password); return authInfo; - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(bearerToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(bearerToken); return authInfo; - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(apikey, apiKeyPrefix); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(apikey, apiKeyPrefix); return authInfo; }{{/isApiKey}}{{#isOAuth}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(accessToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(accessToken); return authInfo; }{{/isOAuth}}{{/authMethods}} } diff --git a/templates/libraries/vertx/Configuration.mustache b/templates/libraries/vertx/Configuration.mustache index 17710ae..5f26ea8 100644 --- a/templates/libraries/vertx/Configuration.mustache +++ b/templates/libraries/vertx/Configuration.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import io.vertx.core.Vertx; @@ -6,6 +8,7 @@ import io.vertx.core.json.JsonObject; import java.util.Objects; public class Configuration { + public static final String VERSION = "{{{artifactVersion}}}"; private static ApiClient defaultApiClient = null; diff --git a/templates/libraries/vertx/apiException.mustache b/templates/libraries/vertx/apiException.mustache index 6e9bbdb..9ce8101 100644 --- a/templates/libraries/vertx/apiException.mustache +++ b/templates/libraries/vertx/apiException.mustache @@ -8,6 +8,8 @@ import io.vertx.core.MultiMap; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private MultiMap responseHeaders = null; private String responseBody = null; diff --git a/templates/libraries/vertx/api_test.mustache b/templates/libraries/vertx/api_test.mustache index 5eb2ec7..1469d11 100644 --- a/templates/libraries/vertx/api_test.mustache +++ b/templates/libraries/vertx/api_test.mustache @@ -6,11 +6,10 @@ package {{package}}; import {{invokerPackage}}.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -21,34 +20,28 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new {{classname}}Impl(); } - {{#operations}}{{#operation}} + + {{#operations}} + {{#operation}} /** * {{summary}} * {{notes}} @@ -66,5 +59,6 @@ public class {{classname}}Test { async.complete(); }); } - {{/operation}}{{/operations}} + {{/operation}} + {{/operations}} } diff --git a/templates/libraries/vertx/build.gradle.mustache b/templates/libraries/vertx/build.gradle.mustache index bc33a07..0e8fd59 100644 --- a/templates/libraries/vertx/build.gradle.mustache +++ b/templates/libraries/vertx/build.gradle.mustache @@ -30,17 +30,14 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" - vertx_version = "3.4.2" - junit_version = "4.13.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + vertx_version = "3.5.2" + junit_version = "5.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -54,16 +51,11 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:jackson_threeten_version" - {{/threetenbp}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/templates/libraries/vertx/pom.mustache b/templates/libraries/vertx/pom.mustache index 2306edb..b9b44cd 100644 --- a/templates/libraries/vertx/pom.mustache +++ b/templates/libraries/vertx/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -151,15 +151,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -211,11 +206,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -266,20 +270,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -289,8 +284,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -304,12 +299,22 @@ UTF-8 - 3.4.2 - 1.5.22 - 2.10.5 - 2.10.5.1 - 0.2.2 + 3.5.2 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.17.1 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - 4.13.1 + {{/useJakartaEe}} + 5.10.3 diff --git a/templates/libraries/webclient/ApiClient.mustache b/templates/libraries/webclient/ApiClient.mustache index 2fa35f5..9072a88 100644 --- a/templates/libraries/webclient/ApiClient.mustache +++ b/templates/libraries/webclient/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -6,8 +8,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -45,7 +45,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -62,15 +61,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -import javax.annotation.Nullable; +import {{javaxPackage}}.annotation.Nullable; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import {{invokerPackage}}.auth.Authentication; @@ -160,8 +154,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected void init() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -522,7 +516,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); } /** diff --git a/templates/libraries/webclient/api.mustache b/templates/libraries/webclient/api.mustache index 166a4fb..65600db 100644 --- a/templates/libraries/webclient/api.mustache +++ b/templates/libraries/webclient/api.mustache @@ -4,15 +4,18 @@ import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -94,11 +97,10 @@ public class {{classname}} { final MultiValueMap formParams = new LinkedMultiValueMap(); {{#hasQueryParams}} - {{#queryParams}} - queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); - {{/queryParams}} - {{/hasQueryParams}} - {{#hasHeaderParams}} + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}} if ({{paramName}} != null) @@ -131,7 +133,7 @@ public class {{classname}} { String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } @@ -147,14 +149,43 @@ public class {{classname}} { * @see {{summary}} Documentation {{/externalDocs}} */ - public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} - return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}bodyToFlux{{/isArray}}{{^isArray}}bodyToMono{{/isArray}}(localVarReturnType); + public {{#returnType}}{{#vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}Flux<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}Mono<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}} {{/returnType}}{{^returnType}}{{#vendorExtensions.x-webclient-blocking}}void{{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}Mono{{/vendorExtensions.x-webclient-blocking}} {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + {{^returnType}}{{^vendorExtensions.x-webclient-blocking}}return {{/vendorExtensions.x-webclient-blocking}}{{/returnType}}{{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#vendorExtensions.x-webclient-return-except-list-of-string}}bodyToFlux{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}bodyToMono{{/vendorExtensions.x-webclient-return-except-list-of-string}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-blocking}}; + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}ResponseEntity>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}Mono>>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}Mono>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/returnType}}{{^returnType}}Mono>{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#vendorExtensions.x-webclient-return-except-list-of-string}}toEntityList{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}toEntity{{/vendorExtensions.x-webclient-return-except-list-of-string}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}.block(){{/vendorExtensions.x-webclient-blocking}}; } - public {{#returnType}}{{#isArray}}Mono>>{{/isArray}}{{^isArray}}Mono>{{/isArray}} {{/returnType}}{{^returnType}}Mono> {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} - return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}toEntityList{{/isArray}}{{^isArray}}toEntity{{/isArray}}(localVarReturnType); + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } {{/operation}} } diff --git a/templates/libraries/webclient/api_test.mustache b/templates/libraries/webclient/api_test.mustache index b9aea53..c5d5686 100644 --- a/templates/libraries/webclient/api_test.mustache +++ b/templates/libraries/webclient/api_test.mustache @@ -4,21 +4,25 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -31,10 +35,11 @@ public class {{classname}}Test { */ @Test public void {{operationId}}Test() { + // uncomment below to test the function {{#allParams}} - {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + //{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; + //{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}; // TODO: test validations } diff --git a/templates/libraries/webclient/auth/ApiKeyAuth.mustache b/templates/libraries/webclient/auth/ApiKeyAuth.mustache index 857403b..d329303 100644 --- a/templates/libraries/webclient/auth/ApiKeyAuth.mustache +++ b/templates/libraries/webclient/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/templates/libraries/webclient/auth/Authentication.mustache b/templates/libraries/webclient/auth/Authentication.mustache index 8e53c2b..0636a6d 100644 --- a/templates/libraries/webclient/auth/Authentication.mustache +++ b/templates/libraries/webclient/auth/Authentication.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/templates/libraries/webclient/auth/HttpBasicAuth.mustache b/templates/libraries/webclient/auth/HttpBasicAuth.mustache index 5b07cb9..fba1265 100644 --- a/templates/libraries/webclient/auth/HttpBasicAuth.mustache +++ b/templates/libraries/webclient/auth/HttpBasicAuth.mustache @@ -1,10 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +35,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/templates/libraries/webclient/auth/HttpBearerAuth.mustache b/templates/libraries/webclient/auth/HttpBearerAuth.mustache index 027c128..45931f9 100644 --- a/templates/libraries/webclient/auth/HttpBearerAuth.mustache +++ b/templates/libraries/webclient/auth/HttpBearerAuth.mustache @@ -1,10 +1,8 @@ -package {{invokerPackage}}.auth; +{{>licenseInfo}} -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; +package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} diff --git a/templates/libraries/webclient/auth/OAuth.mustache b/templates/libraries/webclient/auth/OAuth.mustache index 7889f15..1e1e624 100644 --- a/templates/libraries/webclient/auth/OAuth.mustache +++ b/templates/libraries/webclient/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/templates/libraries/webclient/auth/OAuthFlow.mustache b/templates/libraries/webclient/auth/OAuthFlow.mustache index 7ab35f6..759f354 100644 --- a/templates/libraries/webclient/auth/OAuthFlow.mustache +++ b/templates/libraries/webclient/auth/OAuthFlow.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; public enum OAuthFlow { diff --git a/templates/libraries/webclient/build.gradle.mustache b/templates/libraries/webclient/build.gradle.mustache index 8481b94..5974116 100644 --- a/templates/libraries/webclient/build.gradle.mustache +++ b/templates/libraries/webclient/build.gradle.mustache @@ -32,14 +32,14 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} } // Rename the aar correctly @@ -63,16 +63,16 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -84,14 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} publishing { publications { @@ -103,17 +103,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -124,26 +124,46 @@ if(hasProperty('target') && target == 'android') { } ext { + {{#swagger1AnnotationLibrary}} swagger_annotations_version = "1.6.3" - spring_web_version = "2.4.3" - jackson_version = "2.11.4" - jackson_databind_version = "2.11.4" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + {{#useJakartaEe}} + spring_boot_version = "3.0.12" + jakarta_annotation_version = "2.1.1" + reactor_version = "3.5.12" + reactor_netty_version = "1.1.13" + {{/useJakartaEe}} + {{^useJakartaEe}} + spring_boot_version = "2.7.17" + jakarta_annotation_version = "1.3.5" + reactor_version = "3.4.34" + reactor_netty_version = "1.0.39" + {{/useJakartaEe}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - reactor_version = "3.4.3" - reactor_netty_version = "0.7.15.RELEASE" + {{#joda}} jodatime_version = "2.9.9" - junit_version = "4.13.1" + {{/joda}} + junit_version = "5.10.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" - implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_web_version" - implementation "io.projectreactor.ipc:reactor-netty:$reactor_netty_version" + implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" + implementation "io.projectreactor.netty:reactor-netty-http:$reactor_netty_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -154,12 +174,7 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/templates/libraries/webclient/pom.mustache b/templates/libraries/webclient/pom.mustache index b5e01df..4180b2d 100644 --- a/templates/libraries/webclient/pom.mustache +++ b/templates/libraries/webclient/pom.mustache @@ -43,16 +43,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 + {{#useJakartaEe}} + 17 + 17 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.8 1.8 + {{/useJakartaEe}} org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -66,11 +72,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -89,12 +104,12 @@ org.springframework.boot spring-boot-starter-webflux - ${spring-web-version} + ${spring-boot-version} - io.projectreactor.ipc - reactor-netty + io.projectreactor.netty + reactor-netty-http ${reactor-netty-version} @@ -112,13 +127,11 @@ {{/openApiNullable}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -140,25 +153,38 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.6.3 - 2.4.3 - 2.11.3 - 2.11.4 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} + {{#useJakartaEe}} + 3.0.12 + 2.1.1 + 3.5.12 + 1.1.13 + {{/useJakartaEe}} + {{^useJakartaEe}} + 2.7.17 1.3.5 - 4.13.1 - 3.4.3 - 0.7.15.RELEASE + 3.4.34 + 1.0.39 + {{/useJakartaEe}} + 5.10.2 {{#joda}} 2.9.9 {{/joda}} diff --git a/.github/workflows/maven.yml b/templates/maven.yml.mustache similarity index 84% rename from .github/workflows/maven.yml rename to templates/maven.yml.mustache index 37d2b81..69ad415 100644 --- a/.github/workflows/maven.yml +++ b/templates/maven.yml.mustache @@ -13,16 +13,17 @@ on: jobs: build: - name: Build Dropbox Sign API + name: Build {{{appName}}} runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: + {{=< >=}} java-version: ${{ matrix.java }} distribution: 'temurin' cache: maven diff --git a/templates/model.mustache b/templates/model.mustache index 0c4d165..b504167 100644 --- a/templates/model.mustache +++ b/templates/model.mustache @@ -25,21 +25,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; {{/withXml}} {{#jsonb}} import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; {{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jsonb}} {{#parcelableModel}} @@ -47,12 +49,17 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; {{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} {{#models}} {{#model}} diff --git a/templates/modelEnum.mustache b/templates/modelEnum.mustache index f81c7c9..d1ba359 100644 --- a/templates/modelEnum.mustache +++ b/templates/modelEnum.mustache @@ -9,6 +9,9 @@ import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; {{/gson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} @@ -56,28 +59,29 @@ import com.google.gson.stream.JsonWriter; {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { @Override public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); } @Override public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; - return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} {{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { @@ -97,4 +101,20 @@ import com.google.gson.stream.JsonWriter; } } {{/jsonb}} +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} } diff --git a/templates/modelInnerEnum.mustache b/templates/modelInnerEnum.mustache index a9c9978..0096d84 100644 --- a/templates/modelInnerEnum.mustache +++ b/templates/modelInnerEnum.mustache @@ -51,23 +51,23 @@ {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { @Override public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); } @Override public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } diff --git a/templates/model_test.mustache b/templates/model_test.mustache index 07468db..931a5da 100644 --- a/templates/model_test.mustache +++ b/templates/model_test.mustache @@ -4,21 +4,14 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -{{#fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { {{#models}} {{#model}} {{^vendorExtensions.x-is-one-of-interface}} @@ -30,7 +23,7 @@ public class {{classname}}Test { * Model tests for {{classname}} */ @Test - public void test{{classname}}() { + void test{{classname}}() { // TODO: test {{classname}} } @@ -39,7 +32,7 @@ public class {{classname}}Test { * Test the property '{{name}}' */ @Test - public void {{name}}Test() { + void {{name}}Test() { // TODO: test {{name}} } diff --git a/templates/oneof_interface.mustache b/templates/oneof_interface.mustache index 02deb48..d672772 100644 --- a/templates/oneof_interface.mustache +++ b/templates/oneof_interface.mustache @@ -1,4 +1,4 @@ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} +{{>additionalOneOfTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#discriminator}} public {{propertyType}} {{propertyGetter}}(); diff --git a/templates/pojo.mustache b/templates/pojo.mustache index 7ca5ced..05be7e5 100644 --- a/templates/pojo.mustache +++ b/templates/pojo.mustache @@ -2,17 +2,33 @@ * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} @JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -36,65 +52,87 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} - public {{classname}}() { {{#parent}}{{#parcelableModel}} - super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} - this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} - }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} - + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + /** + * Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} + */ {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} - }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} +{{#vendorExtensions.x-java-all-args-constructor}} + + /** + * Constructor with all args parameters + */ + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { +{{#parent}} + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); +{{/parent}} {{#vars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; +{{/vars}} + } +{{/vendorExtensions.x-java-all-args-constructor}} +{{#vars}} {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -103,10 +141,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -116,11 +154,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -128,10 +164,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -143,7 +179,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } {{/required}} this.{{name}}.put(key, {{name}}Item); @@ -153,7 +189,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -170,25 +206,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} {{#jsonb}} @JsonbProperty("{{baseName}}") {{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -237,7 +281,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isReadOnly}} {{/vars}} + {{#parent}} + {{#readWriteVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{/isOverridden}} + {{/readWriteVars}} + {{/parent}} @Override public boolean equals(Object o) { {{#useReflectionEqualsHashCode}} @@ -287,7 +347,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} sb.append("}"); return sb.toString(); @@ -303,7 +363,200 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -363,4 +616,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} + } diff --git a/templates/pojo_doc.mustache b/templates/pojo_doc.mustache index 2c4eac3..1617ec5 100644 --- a/templates/pojo_doc.mustache +++ b/templates/pojo_doc.mustache @@ -1,22 +1,40 @@ # {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} +{{^useCustomTemplateCode}} +{{#description}}{{&description}} +{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} {{^vendorExtensions.x-is-one-of-interface}} ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +{{^useCustomTemplateCode}} +{{#vars}}|**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{/vars}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isEnum}}[```{{datatypeWithEnum}}```](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}```{{baseType}}{{#items}}<{{dataType}}>```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}```Map```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}```{{dataType}}```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}} | {{/vars}} +{{/useCustomTemplateCode}} {{#vars}}{{#isEnum}} ## Enum: {{datatypeWithEnum}} -Name | Value +| Name | Value | +{{^useCustomTemplateCode}} +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ---- | -----{{#allowableValues}}{{#enumVars}} | {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/useCustomTemplateCode}} {{/isEnum}}{{/vars}} {{#vendorExtensions.x-implements.0}} diff --git a/templates/pom.mustache b/templates/pom.mustache index 5705ea7..b733ab9 100644 --- a/templates/pom.mustache +++ b/templates/pom.mustache @@ -45,6 +45,8 @@ maven-compiler-plugin 3.8.1 + 1.8 + 1.8 true 128m 512m @@ -80,16 +82,24 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -154,33 +164,13 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -232,11 +222,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -272,13 +271,22 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} {{#withXml}} @@ -296,28 +304,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} {{#useBeanValidation}} @@ -352,25 +343,40 @@ - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.6.3 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} 1.19.4 - 2.12.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + 2.17.1 + 2.17.1 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} 1.0.0 - 4.13.1 + 5.10.2 + 1.10.0 diff --git a/templates/typeInfoAnnotation.mustache b/templates/typeInfoAnnotation.mustache index 63eb42e..c21efb4 100644 --- a/templates/typeInfoAnnotation.mustache +++ b/templates/typeInfoAnnotation.mustache @@ -1,6 +1,21 @@ {{#jackson}} +@JsonIgnoreProperties( +{{^useCustomTemplateCode}} + value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + allowSetters = true, // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization + ignoreUnknown = true +{{/useCustomTemplateCode}} +) +{{^useCustomTemplateCode}} +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{/useCustomTemplateCode}} {{#discriminator.mappedModels}} {{#-first}} @JsonSubTypes({ @@ -10,7 +25,4 @@ }) {{/-last}} {{/discriminator.mappedModels}} -{{#isClassnameSanitized}} -@JsonTypeName("{{name}}") -{{/isClassnameSanitized}} {{/jackson}}