diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..06bf2d4 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,25 @@ +name: Trigger Tests on Pull Request. + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '11' + + - name: Gradlew permission + run: chmod +x gradlew \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..356038a --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build +api/ +src/main/java/com/cashfree/client/ +src/test/ +docs/ +README.md \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..9fce6aa --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,380 @@ +.github/workflows/maven.yml +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AadhaarApi.md +docs/AadhaarMaskingResponseSchema.md +docs/AadhaarOcrRequestSchema.md +docs/AadhaarOcrResponseSchema.md +docs/Aadhaarmaskingrequestschema.md +docs/AddressDetails.md +docs/AddressDetailsSplitAddress.md +docs/AdvanceEmploymentRequestSchema.md +docs/AdvanceEmploymentResponse.md +docs/AdvanceEmploymentResponseInput.md +docs/AdvanceEmploymentResponseRecentEmploymentDetails.md +docs/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.md +docs/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.md +docs/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.md +docs/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.md +docs/AdvanceEmploymentResponseUanDetailsInner.md +docs/AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.md +docs/AdvanceEmploymentResponseUanDetailsInnerBasicDetails.md +docs/AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.md +docs/AdvancedEmploymentApi.md +docs/BadgeDetails.md +docs/BulkPanRequestSchema.md +docs/BulkPanRequestSchemaEntriesInner.md +docs/CinApi.md +docs/CinRequestSchema.md +docs/CinResponseSchema.md +docs/CinResponseSchemaDirectorDetailsInner.md +docs/CreateRequestRequestSchema.md +docs/CreateRequestResponseSchema.md +docs/DigiLockerVerificationCreateUrlRequestSchema.md +docs/DigiLockerVerificationCreateUrlResponseSchema.md +docs/DigiLockerVerificationGetDocumentResponseSchema.md +docs/DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.md +docs/DigiLockerVerificationGetStatusResponseSchema.md +docs/DigiLockerVerificationGetStatusResponseSchemaUserDetails.md +docs/DigilockerApi.md +docs/DrivingLicenceDetails.md +docs/DrivingLicenceDetailsSplitAddress.md +docs/DrivingLicenseApi.md +docs/DrivingLicenseRequestSchema.md +docs/DrivingLicenseResponseSchema.md +docs/DrivingLicenseResponseSchemaDlValidity.md +docs/DuplicateVerificationId.md +docs/ESignApi.md +docs/ESignVerificationCreateSignatureRequestSchema.md +docs/ESignVerificationCreateSignatureRequestSchemaSignersInner.md +docs/ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.md +docs/ESignVerificationCreateSignatureResponseSchema.md +docs/ESignVerificationGetStatusResponseSchema.md +docs/ESignVerificationGetStatusResponseSchemaSignersInner.md +docs/ESignVerificationUploadDocumentRequestSchema.md +docs/ESignVerificationUploadDocumentResponseSchema.md +docs/ErrorResponseSchema.md +docs/FaceMatchApi.md +docs/FaceMatchRequestSchema.md +docs/FaceMatchResponseSchema.md +docs/GetPanBulkResponseSchema.md +docs/GetStatusRpdResponseSchema.md +docs/GetVerifyPanResponseSchema.md +docs/GstinApi.md +docs/GstinRequestSchema.md +docs/GstinResponseSchema.md +docs/GstinResponseSchemaAdditionalAddressArrayInner.md +docs/InvalidIpAddress.md +docs/Invaliddoctypeschema.md +docs/IpApi.md +docs/IpVerificationRequestSchema.md +docs/IpVerificationResponseSchema.md +docs/LivelinessApi.md +docs/LivelinessRequestSchema.md +docs/LivelinessResponseSchema.md +docs/NameMatchApi.md +docs/NameMatchRequestSchema.md +docs/NameMatchResponseSchema.md +docs/OfflineAadhaarSendOtpRequestSchema.md +docs/OfflineAadhaarSendOtpResponseSchema.md +docs/OfflineAadhaarVerifyOtpRequestSchema.md +docs/OfflineAadhaarVerifyOtpResponseSchema.md +docs/OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.md +docs/PanAdvanceRequestSchema.md +docs/PanAdvanceResponseSchema.md +docs/PanAdvanceResponseSchemaAddress.md +docs/PanApi.md +docs/PanOcrRequestSchema.md +docs/PanOcrResponseSchema.md +docs/PanRequestSchema.md +docs/PanToGstinApi.md +docs/PanToGstinRequestSchema.md +docs/PanToGstinResponseSchema.md +docs/PanToGstinResponseSchemaGstinListInner.md +docs/PassportApi.md +docs/PassportVerificationRequestSchema.md +docs/PassportVerificationResponseSchema.md +docs/PostPanBulkResponseSchema.md +docs/ReverseGeocodingApi.md +docs/ReverseGeocodingRequestSchema.md +docs/ReverseGeocodingResponseSchema.md +docs/ReversePennyDropApi.md +docs/SplitAddress.md +docs/SplitAddressSchema.md +docs/UpiAdvanceRequestSchema.md +docs/UpiAdvanceResponseSchema.md +docs/UpiApi.md +docs/UpiMobileRequestSchema.md +docs/UpiMobileResponseSchema.md +docs/V2ErrorResponse404SchemaIpVerification.md +docs/ValidityDetails.md +docs/VehicleRcApi.md +docs/VehicleRcRequestSchema.md +docs/VehicleRcResponseSchema.md +docs/VoterIdApi.md +docs/VoterIdRequestSchema.md +docs/VoterIdResponseSchema.md +docs/VpaFromPhone500Schema.md +docs/XClientIdMissing.md +git_push.sh +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/cashfree/ApiCallback.java +src/main/java/com/cashfree/ApiClient.java +src/main/java/com/cashfree/ApiException.java +src/main/java/com/cashfree/ApiResponse.java +src/main/java/com/cashfree/Configuration.java +src/main/java/com/cashfree/GzipRequestInterceptor.java +src/main/java/com/cashfree/JSON.java +src/main/java/com/cashfree/Pair.java +src/main/java/com/cashfree/ProgressRequestBody.java +src/main/java/com/cashfree/ProgressResponseBody.java +src/main/java/com/cashfree/ServerConfiguration.java +src/main/java/com/cashfree/ServerVariable.java +src/main/java/com/cashfree/StringUtil.java +src/main/java/com/cashfree/auth/ApiKeyAuth.java +src/main/java/com/cashfree/auth/Authentication.java +src/main/java/com/cashfree/auth/HttpBasicAuth.java +src/main/java/com/cashfree/auth/HttpBearerAuth.java +src/main/java/com/cashfree/client/AadhaarApi.java +src/main/java/com/cashfree/client/AdvancedEmploymentApi.java +src/main/java/com/cashfree/client/CinApi.java +src/main/java/com/cashfree/client/DigilockerApi.java +src/main/java/com/cashfree/client/DrivingLicenseApi.java +src/main/java/com/cashfree/client/ESignApi.java +src/main/java/com/cashfree/client/FaceMatchApi.java +src/main/java/com/cashfree/client/GstinApi.java +src/main/java/com/cashfree/client/IpApi.java +src/main/java/com/cashfree/client/LivelinessApi.java +src/main/java/com/cashfree/client/NameMatchApi.java +src/main/java/com/cashfree/client/PanApi.java +src/main/java/com/cashfree/client/PanToGstinApi.java +src/main/java/com/cashfree/client/PassportApi.java +src/main/java/com/cashfree/client/ReverseGeocodingApi.java +src/main/java/com/cashfree/client/ReversePennyDropApi.java +src/main/java/com/cashfree/client/UpiApi.java +src/main/java/com/cashfree/client/VehicleRcApi.java +src/main/java/com/cashfree/client/VoterIdApi.java +src/main/java/com/cashfree/model/AadhaarMaskingResponseSchema.java +src/main/java/com/cashfree/model/AadhaarOcrRequestSchema.java +src/main/java/com/cashfree/model/AadhaarOcrResponseSchema.java +src/main/java/com/cashfree/model/Aadhaarmaskingrequestschema.java +src/main/java/com/cashfree/model/AbstractOpenApiSchema.java +src/main/java/com/cashfree/model/AddressDetails.java +src/main/java/com/cashfree/model/AddressDetailsSplitAddress.java +src/main/java/com/cashfree/model/AdvanceEmploymentRequestSchema.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponse.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseInput.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetails.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInner.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerBasicDetails.java +src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.java +src/main/java/com/cashfree/model/BadgeDetails.java +src/main/java/com/cashfree/model/BulkPanRequestSchema.java +src/main/java/com/cashfree/model/BulkPanRequestSchemaEntriesInner.java +src/main/java/com/cashfree/model/CinRequestSchema.java +src/main/java/com/cashfree/model/CinResponseSchema.java +src/main/java/com/cashfree/model/CinResponseSchemaDirectorDetailsInner.java +src/main/java/com/cashfree/model/CreateRequestRequestSchema.java +src/main/java/com/cashfree/model/CreateRequestResponseSchema.java +src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlRequestSchema.java +src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlResponseSchema.java +src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchema.java +src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.java +src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchema.java +src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchemaUserDetails.java +src/main/java/com/cashfree/model/DrivingLicenceDetails.java +src/main/java/com/cashfree/model/DrivingLicenceDetailsSplitAddress.java +src/main/java/com/cashfree/model/DrivingLicenseRequestSchema.java +src/main/java/com/cashfree/model/DrivingLicenseResponseSchema.java +src/main/java/com/cashfree/model/DrivingLicenseResponseSchemaDlValidity.java +src/main/java/com/cashfree/model/DuplicateVerificationId.java +src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchema.java +src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInner.java +src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.java +src/main/java/com/cashfree/model/ESignVerificationCreateSignatureResponseSchema.java +src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchema.java +src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchemaSignersInner.java +src/main/java/com/cashfree/model/ESignVerificationUploadDocumentRequestSchema.java +src/main/java/com/cashfree/model/ESignVerificationUploadDocumentResponseSchema.java +src/main/java/com/cashfree/model/ErrorResponseSchema.java +src/main/java/com/cashfree/model/FaceMatchRequestSchema.java +src/main/java/com/cashfree/model/FaceMatchResponseSchema.java +src/main/java/com/cashfree/model/GetPanBulkResponseSchema.java +src/main/java/com/cashfree/model/GetStatusRpdResponseSchema.java +src/main/java/com/cashfree/model/GetVerifyPanResponseSchema.java +src/main/java/com/cashfree/model/GstinRequestSchema.java +src/main/java/com/cashfree/model/GstinResponseSchema.java +src/main/java/com/cashfree/model/GstinResponseSchemaAdditionalAddressArrayInner.java +src/main/java/com/cashfree/model/InvalidIpAddress.java +src/main/java/com/cashfree/model/Invaliddoctypeschema.java +src/main/java/com/cashfree/model/IpVerificationRequestSchema.java +src/main/java/com/cashfree/model/IpVerificationResponseSchema.java +src/main/java/com/cashfree/model/LivelinessRequestSchema.java +src/main/java/com/cashfree/model/LivelinessResponseSchema.java +src/main/java/com/cashfree/model/NameMatchRequestSchema.java +src/main/java/com/cashfree/model/NameMatchResponseSchema.java +src/main/java/com/cashfree/model/OfflineAadhaarSendOtpRequestSchema.java +src/main/java/com/cashfree/model/OfflineAadhaarSendOtpResponseSchema.java +src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpRequestSchema.java +src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchema.java +src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.java +src/main/java/com/cashfree/model/PanAdvanceRequestSchema.java +src/main/java/com/cashfree/model/PanAdvanceResponseSchema.java +src/main/java/com/cashfree/model/PanAdvanceResponseSchemaAddress.java +src/main/java/com/cashfree/model/PanOcrRequestSchema.java +src/main/java/com/cashfree/model/PanOcrResponseSchema.java +src/main/java/com/cashfree/model/PanRequestSchema.java +src/main/java/com/cashfree/model/PanToGstinRequestSchema.java +src/main/java/com/cashfree/model/PanToGstinResponseSchema.java +src/main/java/com/cashfree/model/PanToGstinResponseSchemaGstinListInner.java +src/main/java/com/cashfree/model/PassportVerificationRequestSchema.java +src/main/java/com/cashfree/model/PassportVerificationResponseSchema.java +src/main/java/com/cashfree/model/PostPanBulkResponseSchema.java +src/main/java/com/cashfree/model/ReverseGeocodingRequestSchema.java +src/main/java/com/cashfree/model/ReverseGeocodingResponseSchema.java +src/main/java/com/cashfree/model/SplitAddress.java +src/main/java/com/cashfree/model/SplitAddressSchema.java +src/main/java/com/cashfree/model/UpiAdvanceRequestSchema.java +src/main/java/com/cashfree/model/UpiAdvanceResponseSchema.java +src/main/java/com/cashfree/model/UpiMobileRequestSchema.java +src/main/java/com/cashfree/model/UpiMobileResponseSchema.java +src/main/java/com/cashfree/model/V2ErrorResponse404SchemaIpVerification.java +src/main/java/com/cashfree/model/ValidityDetails.java +src/main/java/com/cashfree/model/VehicleRcRequestSchema.java +src/main/java/com/cashfree/model/VehicleRcResponseSchema.java +src/main/java/com/cashfree/model/VoterIdRequestSchema.java +src/main/java/com/cashfree/model/VoterIdResponseSchema.java +src/main/java/com/cashfree/model/VpaFromPhone500Schema.java +src/main/java/com/cashfree/model/XClientIdMissing.java +src/test/java/com/cashfree/client/AadhaarApiTest.java +src/test/java/com/cashfree/client/AdvancedEmploymentApiTest.java +src/test/java/com/cashfree/client/CinApiTest.java +src/test/java/com/cashfree/client/DigilockerApiTest.java +src/test/java/com/cashfree/client/DrivingLicenseApiTest.java +src/test/java/com/cashfree/client/ESignApiTest.java +src/test/java/com/cashfree/client/FaceMatchApiTest.java +src/test/java/com/cashfree/client/GstinApiTest.java +src/test/java/com/cashfree/client/IpApiTest.java +src/test/java/com/cashfree/client/LivelinessApiTest.java +src/test/java/com/cashfree/client/NameMatchApiTest.java +src/test/java/com/cashfree/client/PanApiTest.java +src/test/java/com/cashfree/client/PanToGstinApiTest.java +src/test/java/com/cashfree/client/PassportApiTest.java +src/test/java/com/cashfree/client/ReverseGeocodingApiTest.java +src/test/java/com/cashfree/client/ReversePennyDropApiTest.java +src/test/java/com/cashfree/client/UpiApiTest.java +src/test/java/com/cashfree/client/VehicleRcApiTest.java +src/test/java/com/cashfree/client/VoterIdApiTest.java +src/test/java/com/cashfree/model/AadhaarMaskingResponseSchemaTest.java +src/test/java/com/cashfree/model/AadhaarOcrRequestSchemaTest.java +src/test/java/com/cashfree/model/AadhaarOcrResponseSchemaTest.java +src/test/java/com/cashfree/model/AadhaarmaskingrequestschemaTest.java +src/test/java/com/cashfree/model/AddressDetailsSplitAddressTest.java +src/test/java/com/cashfree/model/AddressDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentRequestSchemaTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseInputTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfoTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInnerTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerAdditionalDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerBasicDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerEmploymentDetailsTest.java +src/test/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerTest.java +src/test/java/com/cashfree/model/BadgeDetailsTest.java +src/test/java/com/cashfree/model/BulkPanRequestSchemaEntriesInnerTest.java +src/test/java/com/cashfree/model/BulkPanRequestSchemaTest.java +src/test/java/com/cashfree/model/CinRequestSchemaTest.java +src/test/java/com/cashfree/model/CinResponseSchemaDirectorDetailsInnerTest.java +src/test/java/com/cashfree/model/CinResponseSchemaTest.java +src/test/java/com/cashfree/model/CreateRequestRequestSchemaTest.java +src/test/java/com/cashfree/model/CreateRequestResponseSchemaTest.java +src/test/java/com/cashfree/model/DigiLockerVerificationCreateUrlRequestSchemaTest.java +src/test/java/com/cashfree/model/DigiLockerVerificationCreateUrlResponseSchemaTest.java +src/test/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchemaSplitAddressTest.java +src/test/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchemaTest.java +src/test/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchemaTest.java +src/test/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchemaUserDetailsTest.java +src/test/java/com/cashfree/model/DrivingLicenceDetailsSplitAddressTest.java +src/test/java/com/cashfree/model/DrivingLicenceDetailsTest.java +src/test/java/com/cashfree/model/DrivingLicenseRequestSchemaTest.java +src/test/java/com/cashfree/model/DrivingLicenseResponseSchemaDlValidityTest.java +src/test/java/com/cashfree/model/DrivingLicenseResponseSchemaTest.java +src/test/java/com/cashfree/model/DuplicateVerificationIdTest.java +src/test/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInnerTest.java +src/test/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInnerTest.java +src/test/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaTest.java +src/test/java/com/cashfree/model/ESignVerificationCreateSignatureResponseSchemaTest.java +src/test/java/com/cashfree/model/ESignVerificationGetStatusResponseSchemaSignersInnerTest.java +src/test/java/com/cashfree/model/ESignVerificationGetStatusResponseSchemaTest.java +src/test/java/com/cashfree/model/ESignVerificationUploadDocumentRequestSchemaTest.java +src/test/java/com/cashfree/model/ESignVerificationUploadDocumentResponseSchemaTest.java +src/test/java/com/cashfree/model/ErrorResponseSchemaTest.java +src/test/java/com/cashfree/model/FaceMatchRequestSchemaTest.java +src/test/java/com/cashfree/model/FaceMatchResponseSchemaTest.java +src/test/java/com/cashfree/model/GetPanBulkResponseSchemaTest.java +src/test/java/com/cashfree/model/GetStatusRpdResponseSchemaTest.java +src/test/java/com/cashfree/model/GetVerifyPanResponseSchemaTest.java +src/test/java/com/cashfree/model/GstinRequestSchemaTest.java +src/test/java/com/cashfree/model/GstinResponseSchemaAdditionalAddressArrayInnerTest.java +src/test/java/com/cashfree/model/GstinResponseSchemaTest.java +src/test/java/com/cashfree/model/InvalidIpAddressTest.java +src/test/java/com/cashfree/model/InvaliddoctypeschemaTest.java +src/test/java/com/cashfree/model/IpVerificationRequestSchemaTest.java +src/test/java/com/cashfree/model/IpVerificationResponseSchemaTest.java +src/test/java/com/cashfree/model/LivelinessRequestSchemaTest.java +src/test/java/com/cashfree/model/LivelinessResponseSchemaTest.java +src/test/java/com/cashfree/model/NameMatchRequestSchemaTest.java +src/test/java/com/cashfree/model/NameMatchResponseSchemaTest.java +src/test/java/com/cashfree/model/OfflineAadhaarSendOtpRequestSchemaTest.java +src/test/java/com/cashfree/model/OfflineAadhaarSendOtpResponseSchemaTest.java +src/test/java/com/cashfree/model/OfflineAadhaarVerifyOtpRequestSchemaTest.java +src/test/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchemaSplitAddressTest.java +src/test/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchemaTest.java +src/test/java/com/cashfree/model/PanAdvanceRequestSchemaTest.java +src/test/java/com/cashfree/model/PanAdvanceResponseSchemaAddressTest.java +src/test/java/com/cashfree/model/PanAdvanceResponseSchemaTest.java +src/test/java/com/cashfree/model/PanOcrRequestSchemaTest.java +src/test/java/com/cashfree/model/PanOcrResponseSchemaTest.java +src/test/java/com/cashfree/model/PanRequestSchemaTest.java +src/test/java/com/cashfree/model/PanToGstinRequestSchemaTest.java +src/test/java/com/cashfree/model/PanToGstinResponseSchemaGstinListInnerTest.java +src/test/java/com/cashfree/model/PanToGstinResponseSchemaTest.java +src/test/java/com/cashfree/model/PassportVerificationRequestSchemaTest.java +src/test/java/com/cashfree/model/PassportVerificationResponseSchemaTest.java +src/test/java/com/cashfree/model/PostPanBulkResponseSchemaTest.java +src/test/java/com/cashfree/model/ReverseGeocodingRequestSchemaTest.java +src/test/java/com/cashfree/model/ReverseGeocodingResponseSchemaTest.java +src/test/java/com/cashfree/model/SplitAddressSchemaTest.java +src/test/java/com/cashfree/model/SplitAddressTest.java +src/test/java/com/cashfree/model/UpiAdvanceRequestSchemaTest.java +src/test/java/com/cashfree/model/UpiAdvanceResponseSchemaTest.java +src/test/java/com/cashfree/model/UpiMobileRequestSchemaTest.java +src/test/java/com/cashfree/model/UpiMobileResponseSchemaTest.java +src/test/java/com/cashfree/model/V2ErrorResponse404SchemaIpVerificationTest.java +src/test/java/com/cashfree/model/ValidityDetailsTest.java +src/test/java/com/cashfree/model/VehicleRcRequestSchemaTest.java +src/test/java/com/cashfree/model/VehicleRcResponseSchemaTest.java +src/test/java/com/cashfree/model/VoterIdRequestSchemaTest.java +src/test/java/com/cashfree/model/VoterIdResponseSchemaTest.java +src/test/java/com/cashfree/model/VpaFromPhone500SchemaTest.java +src/test/java/com/cashfree/model/XClientIdMissingTest.java diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..4122521 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1b6741c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/README.md b/README.md index 769f0a9..443f222 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -# Cashfree Verification Suite Java SDK +# Cashfree PG Java SDK ![GitHub](https://img.shields.io/github/license/cashfree/cashfree-verification-sdk-java) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-verification-sdk-java/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-verification-sdk-java?label=latest) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-verification-sdk-java) [![Coverage Status](https://coveralls.io/repos/github/cashfree/cashfree-verification-sdk-java/badge.svg?branch=main)](https://coveralls.io/github/cashfree/cashfree-verification-sdk-java?branch=main) -The Cashfree Verification Suite Java SDK offers a convenient solution to access [Cashfree Verification Suite APIs](https://docs.cashfree.com/reference/verification-new-apis-endpoint) from a server-side Java applications. +The Cashfree PG Java SDK offers a convenient solution to access [Cashfree PG APIs](https://docs.cashfree.com/reference/verification-new-apis-endpoint) from a server-side Java applications. ## Documentation -Cashfree's Verification Suite API Documentation - (https://docs.cashfree.com/reference/verification-api-overview) +Cashfree's PG API Documentation - https://docs.cashfree.com/reference/verification-new-apis-endpoint + +Learn and understand payment gateway workflows at Cashfree Payments [here](https://docs.cashfree.com/docs/payment-gateway) Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com/devstudio) ! @@ -16,14 +18,14 @@ Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com ### Installation * Gradle Project ```bash -implementation `com.cashfree.verification.java:cashfree_verification:` +implementation `com.cashfree.verification.java:cashfree_verification:1.0.1` ``` * Maven Project ```bash com.cashfree.verification.java cashfree_verification - + 1.0.1 compile @@ -34,8 +36,48 @@ implementation `com.cashfree.verification.java:cashfree_verification:` ``` ### Configuration +```java +import com.cashfree.*; + +Cashfree.XClientId = ""; +Cashfree.XClientSecret = ""; +Cashfree.XEnvironment = Cashfree.SANDBOX; + +Cashfree cashfree = new Cashfree(); +String xApiVersion = "2022-09-01"; +``` + Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login) +### Basic Usage +Create Order +```java +CustomerDetails customerDetails = new CustomerDetails(); +customerDetails.setCustomerId("walterwNrcMi"); +customerDetails.setCustomerPhone("9999999999"); + +CreateOrderRequest request = new CreateOrderRequest(); +request.setOrderAmount(1.0); +request.setOrderCurrency("INR"); +request.setCustomerDetails(customerDetails); +try { + ApiResponse response = cashfree.PGCreateOrder(xApiVersion, request, null, null, null); + System.out.println(response.getData().getOrderId()); +} catch (ApiException e) { + throw new RuntimeException(e); +} +``` + +Get Order +```java +try { + ApiResponse responseFetchOrder = cashfree.PGFetchOrder(xApiVersion, "", null, null, null); + System.out.println(response.getData().getOrderId()); +} catch (ApiException e) { + throw new RuntimeException(e); +} +``` + ## Licence Apache Licensed. See [LICENSE.md](LICENSE.md) for more details diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..9807dbc --- /dev/null +++ b/build.gradle @@ -0,0 +1,258 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +group = 'com.cashfree.verification.java' +version = '1.0.1' + +buildscript { + repositories { + mavenCentral() + maven { + url = uri("https://plugins.gradle.org/m2/") + } + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' + } +} +apply plugin: 'io.github.gradle-nexus.publish-plugin' + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +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' + apply plugin: 'signing' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + task sourcesJar(type: Jar) { + archiveClassifier.set('sources') + from sourceSets.main.java.srcDirs + } + + task packageJavadoc(type: Jar) { + archiveClassifier.set('javadoc') + from javadoc.destinationDir + } + + artifacts { + archives sourcesJar + archives packageJavadoc + } + + publishing { + publications { + + release(MavenPublication) { + + groupId 'com.cashfree.verification.java' + artifactId 'cashfree_verification' + version '1.0.1' + + from components.java + + + artifact sourcesJar + artifact packageJavadoc + + // Mostly self-explanatory metadata + pom { + name = 'cashfree_verification' + description = 'Cashfree Payments, PG Java SDK' + url = 'https://github.com/cashfree/cashfree-verification-sdk-java' + licenses { + license { + name = 'Apache License' + url = 'https://github.com/cashfree/cashfree-verification-sdk-java/blob/master/LICENSE.md' + } + } + developers { + developer { + id = 'cashfree' + name = 'Cashfree Payments' + email = 'developers@cashfree.com' + } + // Add all other devs here... + } + + // Version control info - if you're using GitHub, follow the + // format as seen here + scm { + connection = 'scm:git:github.com/cashfree/cashfree-verification-sdk-java.git' + developerConnection = 'scm:git:ssh://github.com/cashfree/cashfree-verification-sdk-java.git' + url = 'https://github.com/cashfree/cashfree-verification-sdk-java' + } + } + } + } + repositories { + maven { + name = "OSSRH" + url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } + } + } + + signing { + useInMemoryPgpKeys( + System.getenv("SIGNING_KEY_ID"), + System.getenv("SIGNING_KEY"), + System.getenv("SIGNING_PASSWORD"), + ) + sign publishing.publications + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger.core.v3:swagger-annotations:2.2.9' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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() + } +} + +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" + } + +} + +nexusPublishing { + repositories { + sonatype { + stagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } +} diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..073622b --- /dev/null +++ b/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "com.cashfree.verification.java", + name := "cashfree_verification", + version := "1.0.1", + 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.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..64aed5a --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="cashfree" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cashfree-verification-sdk-java" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..a340857 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# 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 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..7454180 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..da1db5f --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..005bcde --- /dev/null +++ b/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# 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 +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +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" ] +do + 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" +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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +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 + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + 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. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +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 +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# 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 +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. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + 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 new file mode 100644 index 0000000..6a68175 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +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" + +@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 + +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. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +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. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="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 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4331591 --- /dev/null +++ b/pom.xml @@ -0,0 +1,365 @@ + + 4.0.0 + com.cashfree.verification.java + cashfree_verification + jar + cashfree_verification + 1.0.1 + https://github.com/cashfree/cashfree-verification-sdk-java + Java Framework for Cashfree Verification. + + scm:git:git@github.com:cashfree/cashfree-verification-sdk-java.git + scm:git:git@github.com:cashfree/cashfree-verification-sdk-java.git + git@github.com:cashfree/cashfree-verification-sdk-java.git + + + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + Apache + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + Cashfree Payments + developers@cashfree.com + Cashfree Payments Pvt Ltd + https://cashfree.com + + + + + + + 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.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.core.v3 + swagger-annotations + ${swagger-annotations-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} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 2.2.9 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..97433b8 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "cashfree_verification" \ No newline at end of file diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..73bbc2f --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/java/com/cashfree/ApiCallback.java b/src/main/java/com/cashfree/ApiCallback.java new file mode 100644 index 0000000..ed4fd9d --- /dev/null +++ b/src/main/java/com/cashfree/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +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/src/main/java/com/cashfree/ApiException.java b/src/main/java/com/cashfree/ApiException.java new file mode 100644 index 0000000..f00dc26 --- /dev/null +++ b/src/main/java/com/cashfree/ApiException.java @@ -0,0 +1,165 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = 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; + this.responseHeaders = responseHeaders; + 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("Response Code: " + code + " Response Body: " + responseBody, (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); + this.responseHeaders = responseHeaders; + 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 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()); + } +} diff --git a/src/main/java/com/cashfree/ApiResponse.java b/src/main/java/com/cashfree/ApiResponse.java new file mode 100644 index 0000000..7405587 --- /dev/null +++ b/src/main/java/com/cashfree/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +import java.util.List; +import java.util.Map; + +/** + * 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; + this.headers = headers; + 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/src/main/java/com/cashfree/Cashfree.java b/src/main/java/com/cashfree/Cashfree.java new file mode 100644 index 0000000..836c19d --- /dev/null +++ b/src/main/java/com/cashfree/Cashfree.java @@ -0,0 +1,4884 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +import com.cashfree.model.*; +import com.google.gson.reflect.TypeToken; + +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; + +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; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.util.Base64; +import com.google.gson.Gson; + +import com.cashfree.auth.Authentication; +import com.cashfree.auth.HttpBasicAuth; +import com.cashfree.auth.HttpBearerAuth; +import com.cashfree.auth.ApiKeyAuth; + + +public class Cashfree { + + enum CFEnvironment { + SANDBOX, + PRODUCTION; + } + + public static String XClientId = ""; + public static String XClientSecret = ""; + public static String XApiVersion = "2023-12-18"; + public static CFEnvironment XEnvironment = CFEnvironment.SANDBOX; + + public static CFEnvironment SANDBOX = CFEnvironment.SANDBOX; + public static CFEnvironment PRODUCTION = CFEnvironment.PRODUCTION; + + private ApiClient localVarApiClient = new ApiClient(); + + + /** + * Build call for vrsAadhaarOcrVerification + * @param verificationId It is the unique ID you create to identify the request. The maximum character limit is 50. Only alphanumeric, hyphen (-), period (.), and underscore ( _ ) are allowed. (required) + * @param frontImage It is the scanned image of the front of the aadhaar card. Allowed file type - JPEG/JPG/PNG. The max file size of both the files is 10MB. (required) + * @param xApiVersion It is the API version. To receive the aadhaar seeding status in the response, use any date after 2022-09-12 (optional) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param backImage It is the scanned image of the back of the aadhaar card. Allowed file type - JPEG/JPG/PNG. The max file size of both the files is 10MB. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifying aadhaar information -
400 Validation errors for OCR APIs -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsAadhaarOcrVerificationCall(String verificationId, File frontImage, String xApiVersion, String xCfSignature, File backImage, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/document/aadhaar"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (verificationId != null) { + localVarFormParams.put("verification_id", verificationId); + } + + if (backImage != null) { + localVarFormParams.put("back_image", backImage); + } + + if (frontImage != null) { + localVarFormParams.put("front_image", frontImage); + } + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsAadhaarOcrVerificationValidateBeforeCall(String verificationId, File frontImage, String xApiVersion, String xCfSignature, File backImage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'verificationId' is set + if (verificationId == null) { + throw new ApiException("Missing the required parameter 'verificationId' when calling VrsAadhaarOcrVerification(Async)"); + } + + // verify the required parameter 'frontImage' is set + if (frontImage == null) { + throw new ApiException("Missing the required parameter 'frontImage' when calling VrsAadhaarOcrVerification(Async)"); + } + + return vrsAadhaarOcrVerificationCall(verificationId, frontImage, xApiVersion, xCfSignature, backImage, _callback); + + } + + public ApiResponse VrsAadhaarOcrVerification(String verificationId, File frontImage, String xApiVersion, String xCfSignature, File backImage, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsAadhaarOcrVerificationValidateBeforeCall(verificationId, frontImage, xApiVersion, xCfSignature, backImage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsMaskAadhaar + * @param image It is the image file of the aadhaar card that needs masking. Accepted formats - short, long, and PVC. Allowed file type - JPEG/JPG/PNG. The maximum file size should be 10 MB. (required) + * @param verificationId It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for masking aadhaar number -
400 Bad request for Aadhaar Masking API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
413 File size exceeded -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsMaskAadhaarCall(File image, String verificationId, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/aadhaar-masking"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (image != null) { + localVarFormParams.put("image", image); + } + + if (verificationId != null) { + localVarFormParams.put("verification_id", verificationId); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsMaskAadhaarValidateBeforeCall(File image, String verificationId, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'image' is set + if (image == null) { + throw new ApiException("Missing the required parameter 'image' when calling VrsMaskAadhaar(Async)"); + } + + // verify the required parameter 'verificationId' is set + if (verificationId == null) { + throw new ApiException("Missing the required parameter 'verificationId' when calling VrsMaskAadhaar(Async)"); + } + + return vrsMaskAadhaarCall(image, verificationId, xCfSignature, _callback); + + } + + public ApiResponse VrsMaskAadhaar(File image, String verificationId, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsMaskAadhaarValidateBeforeCall(image, verificationId, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsOfflineAadhaarSendOtp + * @param offlineAadhaarSendOtpRequestSchema Find the request parameters to generate OTP for a given aadhar number (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for generating the OTP for offline aadhaar verification -
400 Validation errors for Generate OTP to Verify Aadhaar API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error for requesting another OTP for the same aadhaar within 30 seconds -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsOfflineAadhaarSendOtpCall(OfflineAadhaarSendOtpRequestSchema offlineAadhaarSendOtpRequestSchema, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = offlineAadhaarSendOtpRequestSchema; + + // create path and map variables + String localVarPath = "/offline-aadhaar/otp"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsOfflineAadhaarSendOtpValidateBeforeCall(OfflineAadhaarSendOtpRequestSchema offlineAadhaarSendOtpRequestSchema, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'offlineAadhaarSendOtpRequestSchema' is set + if (offlineAadhaarSendOtpRequestSchema == null) { + throw new ApiException("Missing the required parameter 'offlineAadhaarSendOtpRequestSchema' when calling VrsOfflineAadhaarSendOtp(Async)"); + } + + return vrsOfflineAadhaarSendOtpCall(offlineAadhaarSendOtpRequestSchema, _callback); + + } + + public ApiResponse VrsOfflineAadhaarSendOtp(OfflineAadhaarSendOtpRequestSchema offlineAadhaarSendOtpRequestSchema, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsOfflineAadhaarSendOtpValidateBeforeCall(offlineAadhaarSendOtpRequestSchema, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsOfflineAadhaarVerifyOtp + * @param offlineAadhaarVerifyOtpRequestSchema Find the request parameters to submit the generated OTP (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for submitting the generated OTP for offline aadhaar verification -
400 Validation errors for Submit OTP for Aadhaar Verification API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsOfflineAadhaarVerifyOtpCall(OfflineAadhaarVerifyOtpRequestSchema offlineAadhaarVerifyOtpRequestSchema, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = offlineAadhaarVerifyOtpRequestSchema; + + // create path and map variables + String localVarPath = "/offline-aadhaar/verify"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsOfflineAadhaarVerifyOtpValidateBeforeCall(OfflineAadhaarVerifyOtpRequestSchema offlineAadhaarVerifyOtpRequestSchema, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'offlineAadhaarVerifyOtpRequestSchema' is set + if (offlineAadhaarVerifyOtpRequestSchema == null) { + throw new ApiException("Missing the required parameter 'offlineAadhaarVerifyOtpRequestSchema' when calling VrsOfflineAadhaarVerifyOtp(Async)"); + } + + return vrsOfflineAadhaarVerifyOtpCall(offlineAadhaarVerifyOtpRequestSchema, _callback); + + } + + public ApiResponse VrsOfflineAadhaarVerifyOtp(OfflineAadhaarVerifyOtpRequestSchema offlineAadhaarVerifyOtpRequestSchema, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsOfflineAadhaarVerifyOtpValidateBeforeCall(offlineAadhaarVerifyOtpRequestSchema, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsAdvanceEmploymentVerification + * @param advanceEmploymentRequestSchema Find the request parameters to retrieve employment details (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retreiving employment information -
400 Validation errors for Advanced Employment API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsAdvanceEmploymentVerificationCall(AdvanceEmploymentRequestSchema advanceEmploymentRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = advanceEmploymentRequestSchema; + + // create path and map variables + String localVarPath = "/advance-employment"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsAdvanceEmploymentVerificationValidateBeforeCall(AdvanceEmploymentRequestSchema advanceEmploymentRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'advanceEmploymentRequestSchema' is set + if (advanceEmploymentRequestSchema == null) { + throw new ApiException("Missing the required parameter 'advanceEmploymentRequestSchema' when calling VrsAdvanceEmploymentVerification(Async)"); + } + + return vrsAdvanceEmploymentVerificationCall(advanceEmploymentRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsAdvanceEmploymentVerification(AdvanceEmploymentRequestSchema advanceEmploymentRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsAdvanceEmploymentVerificationValidateBeforeCall(advanceEmploymentRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsCinVerification + * @param cinRequestSchema Find the request parameters to retrieve your customer's CIN information (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the CIN information -
400 Validation errors for Verify Cin API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsCinVerificationCall(CinRequestSchema cinRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = cinRequestSchema; + + // create path and map variables + String localVarPath = "/cin"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsCinVerificationValidateBeforeCall(CinRequestSchema cinRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'cinRequestSchema' is set + if (cinRequestSchema == null) { + throw new ApiException("Missing the required parameter 'cinRequestSchema' when calling VrsCinVerification(Async)"); + } + + return vrsCinVerificationCall(cinRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsCinVerification(CinRequestSchema cinRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsCinVerificationValidateBeforeCall(cinRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsDigilockerVerificationCreateUrl + * @param digiLockerVerificationCreateUrlRequestSchema Find the request parameters to create a DigiLocker URL to retrieve and verify aadhaar information (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for creating a DigiLocker URL for document verification -
400 Validation errors for Create DigiLocker URL API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error because of an existing verification id for DigiLocker request -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsDigilockerVerificationCreateUrlCall(DigiLockerVerificationCreateUrlRequestSchema digiLockerVerificationCreateUrlRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = digiLockerVerificationCreateUrlRequestSchema; + + // create path and map variables + String localVarPath = "/digilocker"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsDigilockerVerificationCreateUrlValidateBeforeCall(DigiLockerVerificationCreateUrlRequestSchema digiLockerVerificationCreateUrlRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'digiLockerVerificationCreateUrlRequestSchema' is set + if (digiLockerVerificationCreateUrlRequestSchema == null) { + throw new ApiException("Missing the required parameter 'digiLockerVerificationCreateUrlRequestSchema' when calling VrsDigilockerVerificationCreateUrl(Async)"); + } + + return vrsDigilockerVerificationCreateUrlCall(digiLockerVerificationCreateUrlRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsDigilockerVerificationCreateUrl(DigiLockerVerificationCreateUrlRequestSchema digiLockerVerificationCreateUrlRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsDigilockerVerificationCreateUrlValidateBeforeCall(digiLockerVerificationCreateUrlRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsDigilockerVerificationFetchDocument + * @param documentType It is the type of document to be verified. (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param referenceId It is the unique ID created by Cashfree Payments that you receive in the response of Create DigiLocker URL API (optional, default to 12345) + * @param verificationId It is the unique ID you created to identify the Create DigiLocker URL API request. (optional, default to ABC000123) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the document from DigiLocker -
202 Validation in pending state -
400 Validation errors for Get DigiLocker Document API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
404 Not found errors when IDs don't exist -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsDigilockerVerificationFetchDocumentCall(String documentType, String xCfSignature, Integer referenceId, String verificationId, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/digilocker/document/{document_type}" + .replace("{" + "document_type" + "}", localVarApiClient.escapeString(documentType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (referenceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reference_id", referenceId)); + } + + if (verificationId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verification_id", verificationId)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsDigilockerVerificationFetchDocumentValidateBeforeCall(String documentType, String xCfSignature, Integer referenceId, String verificationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'documentType' is set + if (documentType == null) { + throw new ApiException("Missing the required parameter 'documentType' when calling VrsDigilockerVerificationFetchDocument(Async)"); + } + + return vrsDigilockerVerificationFetchDocumentCall(documentType, xCfSignature, referenceId, verificationId, _callback); + + } + + public ApiResponse VrsDigilockerVerificationFetchDocument(String documentType, String xCfSignature, Integer referenceId, String verificationId, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsDigilockerVerificationFetchDocumentValidateBeforeCall(documentType, xCfSignature, referenceId, verificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsDigilockerVerificationFetchStatus + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param referenceId It is the unique ID created by Cashfree Payments that you received in the Create DigiLocker URL API response. (optional, default to 12345) + * @param verificationId It is the unique ID you created to identify the Create DigiLocker URL API request. (optional, default to ABC00123) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the status of the DigiLocker document verification request -
400 Validation errors for Get DigiLocker Verification Status API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
404 Not found errors when IDs don't exist -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsDigilockerVerificationFetchStatusCall(String xCfSignature, Integer referenceId, String verificationId, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/digilocker"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (referenceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reference_id", referenceId)); + } + + if (verificationId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verification_id", verificationId)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsDigilockerVerificationFetchStatusValidateBeforeCall(String xCfSignature, Integer referenceId, String verificationId, final ApiCallback _callback) throws ApiException { + return vrsDigilockerVerificationFetchStatusCall(xCfSignature, referenceId, verificationId, _callback); + + } + + public ApiResponse VrsDigilockerVerificationFetchStatus(String xCfSignature, Integer referenceId, String verificationId, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsDigilockerVerificationFetchStatusValidateBeforeCall(xCfSignature, referenceId, verificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsDrivingLicenseVerification + * @param drivingLicenseRequestSchema Find the request paramenters to retrieve your customer's driving license information (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the driving licence information -
400 Validation errors for Verify Driving Licence API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsDrivingLicenseVerificationCall(DrivingLicenseRequestSchema drivingLicenseRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = drivingLicenseRequestSchema; + + // create path and map variables + String localVarPath = "/driving-license"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsDrivingLicenseVerificationValidateBeforeCall(DrivingLicenseRequestSchema drivingLicenseRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'drivingLicenseRequestSchema' is set + if (drivingLicenseRequestSchema == null) { + throw new ApiException("Missing the required parameter 'drivingLicenseRequestSchema' when calling VrsDrivingLicenseVerification(Async)"); + } + + return vrsDrivingLicenseVerificationCall(drivingLicenseRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsDrivingLicenseVerification(DrivingLicenseRequestSchema drivingLicenseRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsDrivingLicenseVerificationValidateBeforeCall(drivingLicenseRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsESignCreateSignature + * @param esignVerificationCreateSignatureRequestSchema Find the request parameters to add the details of the document and signer (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for creating an e-signature request -
400 Validation errors for Create E-Sign Request API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsESignCreateSignatureCall(ESignVerificationCreateSignatureRequestSchema esignVerificationCreateSignatureRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = esignVerificationCreateSignatureRequestSchema; + + // create path and map variables + String localVarPath = "/esignature"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsESignCreateSignatureValidateBeforeCall(ESignVerificationCreateSignatureRequestSchema esignVerificationCreateSignatureRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'esignVerificationCreateSignatureRequestSchema' is set + if (esignVerificationCreateSignatureRequestSchema == null) { + throw new ApiException("Missing the required parameter 'esignVerificationCreateSignatureRequestSchema' when calling VrsESignCreateSignature(Async)"); + } + + return vrsESignCreateSignatureCall(esignVerificationCreateSignatureRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsESignCreateSignature(ESignVerificationCreateSignatureRequestSchema esignVerificationCreateSignatureRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsESignCreateSignatureValidateBeforeCall(esignVerificationCreateSignatureRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsESignUploadDocument + * @param document Upload the document that requires an e-sign. Allowed file type - PDF. Max file size allowed - 10MB. (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for uploading the document for e-signature -
400 Validation errors for Upload Document For E-Sign API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsESignUploadDocumentCall(File document, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/esignature/document"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (document != null) { + localVarFormParams.put("document", document); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsESignUploadDocumentValidateBeforeCall(File document, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'document' is set + if (document == null) { + throw new ApiException("Missing the required parameter 'document' when calling VrsESignUploadDocument(Async)"); + } + + return vrsESignUploadDocumentCall(document, xCfSignature, _callback); + + } + + public ApiResponse VrsESignUploadDocument(File document, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsESignUploadDocumentValidateBeforeCall(document, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsESignVerificationFetchStatus + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param referenceId It is the unique ID created by Cashfree Payments that you receive in the response of Create E-Sign Request API. (optional, default to 54321) + * @param verificationId It is the unique ID you create to identify the Create E-Sign Request API. (optional, default to ABC00123) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the status of an e-signature request -
400 Validation errors for Get E-Sign Status API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsESignVerificationFetchStatusCall(String xCfSignature, Integer referenceId, String verificationId, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/esignature"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (referenceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reference_id", referenceId)); + } + + if (verificationId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verification_id", verificationId)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsESignVerificationFetchStatusValidateBeforeCall(String xCfSignature, Integer referenceId, String verificationId, final ApiCallback _callback) throws ApiException { + return vrsESignVerificationFetchStatusCall(xCfSignature, referenceId, verificationId, _callback); + + } + + public ApiResponse VrsESignVerificationFetchStatus(String xCfSignature, Integer referenceId, String verificationId, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsESignVerificationFetchStatusValidateBeforeCall(xCfSignature, referenceId, verificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsFaceMatchVerification + * @param verificationId It is the unique ID you need to create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed. (required) + * @param firstImage It is the scanned copy of the image 1. Allowed file type - JPEG/JPG/PNG. Maximum file size allowed for both the files is 10 MB. (required) + * @param secondImage It is the scanned copy of the image 2. Allowed file type - JPEG/JPG/PNG. Maximum file size allowed for both the files is 10 MB. (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param threshold It is the value to distinguish and match the facial features of the two images. The range is between 0 and 1. The default value is set as 0.7. We conclude that the images match when the analysis is or greater than the value set for threshold. (optional, default to 0.5) + * @param detectMaskFirstImage It is a boolean value to identify whether the person in the first image is wearing a mask. (optional) + * @param detectMaskSecondImage It is a boolean value to identify whether the person in the first image is wearing a mask. (optional) + * @param alignHorizontally It is a boolean value to align the images horizontally before analysing the facial features. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifying facial features of your customer in two images -
400 Validation errors for Face Match API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsFaceMatchVerificationCall(String verificationId, File firstImage, File secondImage, String xCfSignature, String threshold, Boolean detectMaskFirstImage, Boolean detectMaskSecondImage, Boolean alignHorizontally, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/face-match"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (verificationId != null) { + localVarFormParams.put("verification_id", verificationId); + } + + if (firstImage != null) { + localVarFormParams.put("first_image", firstImage); + } + + if (secondImage != null) { + localVarFormParams.put("second_image", secondImage); + } + + if (threshold != null) { + localVarFormParams.put("threshold", threshold); + } + + if (detectMaskFirstImage != null) { + localVarFormParams.put("detect_mask_first_image", detectMaskFirstImage); + } + + if (detectMaskSecondImage != null) { + localVarFormParams.put("detect_mask_second_image", detectMaskSecondImage); + } + + if (alignHorizontally != null) { + localVarFormParams.put("align_horizontally", alignHorizontally); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsFaceMatchVerificationValidateBeforeCall(String verificationId, File firstImage, File secondImage, String xCfSignature, String threshold, Boolean detectMaskFirstImage, Boolean detectMaskSecondImage, Boolean alignHorizontally, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'verificationId' is set + if (verificationId == null) { + throw new ApiException("Missing the required parameter 'verificationId' when calling VrsFaceMatchVerification(Async)"); + } + + // verify the required parameter 'firstImage' is set + if (firstImage == null) { + throw new ApiException("Missing the required parameter 'firstImage' when calling VrsFaceMatchVerification(Async)"); + } + + // verify the required parameter 'secondImage' is set + if (secondImage == null) { + throw new ApiException("Missing the required parameter 'secondImage' when calling VrsFaceMatchVerification(Async)"); + } + + return vrsFaceMatchVerificationCall(verificationId, firstImage, secondImage, xCfSignature, threshold, detectMaskFirstImage, detectMaskSecondImage, alignHorizontally, _callback); + + } + + public ApiResponse VrsFaceMatchVerification(String verificationId, File firstImage, File secondImage, String xCfSignature, String threshold, Boolean detectMaskFirstImage, Boolean detectMaskSecondImage, Boolean alignHorizontally, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsFaceMatchVerificationValidateBeforeCall(verificationId, firstImage, secondImage, xCfSignature, threshold, detectMaskFirstImage, detectMaskSecondImage, alignHorizontally, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsGstinVerification + * @param gstinRequestSchema Find the request parameters to retrieve GSTIN information (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving GSTIN information -
400 Validation errors for Verify GSTIN API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsGstinVerificationCall(GstinRequestSchema gstinRequestSchema, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = gstinRequestSchema; + + // create path and map variables + String localVarPath = "/gstin"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsGstinVerificationValidateBeforeCall(GstinRequestSchema gstinRequestSchema, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'gstinRequestSchema' is set + if (gstinRequestSchema == null) { + throw new ApiException("Missing the required parameter 'gstinRequestSchema' when calling VrsGstinVerification(Async)"); + } + + return vrsGstinVerificationCall(gstinRequestSchema, _callback); + + } + + public ApiResponse VrsGstinVerification(GstinRequestSchema gstinRequestSchema, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsGstinVerificationValidateBeforeCall(gstinRequestSchema, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsIpVerification + * @param ipVerificationRequestSchema Find the request parameters to retrieve location information of an IP address (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 IP verified successfully -
400 Validation errors for Ip Verification -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
404 IP not found -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsIpVerificationCall(IpVerificationRequestSchema ipVerificationRequestSchema, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = ipVerificationRequestSchema; + + // create path and map variables + String localVarPath = "/ip"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsIpVerificationValidateBeforeCall(IpVerificationRequestSchema ipVerificationRequestSchema, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'ipVerificationRequestSchema' is set + if (ipVerificationRequestSchema == null) { + throw new ApiException("Missing the required parameter 'ipVerificationRequestSchema' when calling VrsIpVerification(Async)"); + } + + return vrsIpVerificationCall(ipVerificationRequestSchema, _callback); + + } + + public ApiResponse VrsIpVerification(IpVerificationRequestSchema ipVerificationRequestSchema, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsIpVerificationValidateBeforeCall(ipVerificationRequestSchema, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsLivelinessCheck + * @param verificationId It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed. (required) + * @param image Upload the image of the individual to verify the liveliness of the image. (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param strictCheck It is the boolean value to set the strictness check of the image. Default value for strict_check is false. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for checking the liveliness of your customer -
400 Validation errors for Liveliness Check API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsLivelinessCheckCall(String verificationId, File image, String xCfSignature, Boolean strictCheck, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/liveliness"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (verificationId != null) { + localVarFormParams.put("verification_id", verificationId); + } + + if (image != null) { + localVarFormParams.put("image", image); + } + + if (strictCheck != null) { + localVarFormParams.put("strict_check", strictCheck); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsLivelinessCheckValidateBeforeCall(String verificationId, File image, String xCfSignature, Boolean strictCheck, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'verificationId' is set + if (verificationId == null) { + throw new ApiException("Missing the required parameter 'verificationId' when calling VrsLivelinessCheck(Async)"); + } + + // verify the required parameter 'image' is set + if (image == null) { + throw new ApiException("Missing the required parameter 'image' when calling VrsLivelinessCheck(Async)"); + } + + return vrsLivelinessCheckCall(verificationId, image, xCfSignature, strictCheck, _callback); + + } + + public ApiResponse VrsLivelinessCheck(String verificationId, File image, String xCfSignature, Boolean strictCheck, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsLivelinessCheckValidateBeforeCall(verificationId, image, xCfSignature, strictCheck, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsNameMatchVerification + * @param nameMatchRequestSchema Find the request parameters to verify names with variations (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifing name variations -
400 Validation errors for Name Match API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsNameMatchVerificationCall(NameMatchRequestSchema nameMatchRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = nameMatchRequestSchema; + + // create path and map variables + String localVarPath = "/name-match"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsNameMatchVerificationValidateBeforeCall(NameMatchRequestSchema nameMatchRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'nameMatchRequestSchema' is set + if (nameMatchRequestSchema == null) { + throw new ApiException("Missing the required parameter 'nameMatchRequestSchema' when calling VrsNameMatchVerification(Async)"); + } + + return vrsNameMatchVerificationCall(nameMatchRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsNameMatchVerification(NameMatchRequestSchema nameMatchRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsNameMatchVerificationValidateBeforeCall(nameMatchRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsBulkPanVerification + * @param bulkPanRequestSchema Find the request parameters to verify a large number of PAN information (required) + * @param xApiVersion It is the API version. To receive the aadhaar seeding status in the response, use any date after 2022-09-12 (optional) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifying a large number of PAN information -
400 Validation errors for Verify Bulk PAN API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsBulkPanVerificationCall(BulkPanRequestSchema bulkPanRequestSchema, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = bulkPanRequestSchema; + + // create path and map variables + String localVarPath = "/pan/bulk"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsBulkPanVerificationValidateBeforeCall(BulkPanRequestSchema bulkPanRequestSchema, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'bulkPanRequestSchema' is set + if (bulkPanRequestSchema == null) { + throw new ApiException("Missing the required parameter 'bulkPanRequestSchema' when calling VrsBulkPanVerification(Async)"); + } + + return vrsBulkPanVerificationCall(bulkPanRequestSchema, xApiVersion, xCfSignature, _callback); + + } + + public ApiResponse VrsBulkPanVerification(BulkPanRequestSchema bulkPanRequestSchema, String xApiVersion, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsBulkPanVerificationValidateBeforeCall(bulkPanRequestSchema, xApiVersion, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsFetchBulkPanDetails + * @param referenceId It is the unique ID created by Cashfree Payments that you receive in the response of Verify PAN in Bulk API. (required) + * @param bulkVerificationId It is the unique ID you created to identify the Verify PAN in Bulk API request. (required) + * @param xApiVersion It is the API version. To receive the aadhaar seeding status in the response, use any date after 2022-09-12 (optional) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifying a large number of PAN information -
400 Validation errors for Get Bulk PAN Status API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsFetchBulkPanDetailsCall(String referenceId, String bulkVerificationId, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pan/bulk"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (referenceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("reference_id", referenceId)); + } + + if (bulkVerificationId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("bulk_verification_id", bulkVerificationId)); + } + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsFetchBulkPanDetailsValidateBeforeCall(String referenceId, String bulkVerificationId, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'referenceId' is set + if (referenceId == null) { + throw new ApiException("Missing the required parameter 'referenceId' when calling VrsFetchBulkPanDetails(Async)"); + } + + // verify the required parameter 'bulkVerificationId' is set + if (bulkVerificationId == null) { + throw new ApiException("Missing the required parameter 'bulkVerificationId' when calling VrsFetchBulkPanDetails(Async)"); + } + + return vrsFetchBulkPanDetailsCall(referenceId, bulkVerificationId, xApiVersion, xCfSignature, _callback); + + } + + public ApiResponse VrsFetchBulkPanDetails(String referenceId, String bulkVerificationId, String xApiVersion, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsFetchBulkPanDetailsValidateBeforeCall(referenceId, bulkVerificationId, xApiVersion, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsFetchPanDetails + * @param referenceId It is the unique ID created by Cashfree Payments that you receive in the response of Verify PAN Sync API. (required) + * @param xApiVersion It is the API version. To receive the aadhaar seeding status in the response, use any date after 2022-09-12 (optional) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifiying PAN information -
400 Validation error because x-client-id is missing in the request -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
404 Not found error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsFetchPanDetailsCall(String referenceId, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pan/{reference_id}" + .replace("{" + "reference_id" + "}", localVarApiClient.escapeString(referenceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsFetchPanDetailsValidateBeforeCall(String referenceId, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'referenceId' is set + if (referenceId == null) { + throw new ApiException("Missing the required parameter 'referenceId' when calling VrsFetchPanDetails(Async)"); + } + + return vrsFetchPanDetailsCall(referenceId, xApiVersion, xCfSignature, _callback); + + } + + public ApiResponse VrsFetchPanDetails(String referenceId, String xApiVersion, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsFetchPanDetailsValidateBeforeCall(referenceId, xApiVersion, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsPanAdvanceVerification + * @param panAdvanceRequestSchema Find the request parameters to retrieve the PAN information (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the PAN information -
400 Validation errors for PAN 360 API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsPanAdvanceVerificationCall(PanAdvanceRequestSchema panAdvanceRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = panAdvanceRequestSchema; + + // create path and map variables + String localVarPath = "/pan/advance"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsPanAdvanceVerificationValidateBeforeCall(PanAdvanceRequestSchema panAdvanceRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'panAdvanceRequestSchema' is set + if (panAdvanceRequestSchema == null) { + throw new ApiException("Missing the required parameter 'panAdvanceRequestSchema' when calling VrsPanAdvanceVerification(Async)"); + } + + return vrsPanAdvanceVerificationCall(panAdvanceRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsPanAdvanceVerification(PanAdvanceRequestSchema panAdvanceRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsPanAdvanceVerificationValidateBeforeCall(panAdvanceRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsPanOcrVerification + * @param verificationId It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. (required) + * @param frontImage It is the scanned copy of the PAN card. Allowed file type - JPEG/JPG/PNG. (required) + * @param xApiVersion It is the API version. To receive the aadhaar seeding status in the response, use any date after 2022-09-12 (optional) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifiying the PAN information -
400 Validation errors for OCR APIs -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsPanOcrVerificationCall(String verificationId, File frontImage, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/document/pan"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (verificationId != null) { + localVarFormParams.put("verification_id", verificationId); + } + + if (frontImage != null) { + localVarFormParams.put("front_image", frontImage); + } + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsPanOcrVerificationValidateBeforeCall(String verificationId, File frontImage, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'verificationId' is set + if (verificationId == null) { + throw new ApiException("Missing the required parameter 'verificationId' when calling VrsPanOcrVerification(Async)"); + } + + // verify the required parameter 'frontImage' is set + if (frontImage == null) { + throw new ApiException("Missing the required parameter 'frontImage' when calling VrsPanOcrVerification(Async)"); + } + + return vrsPanOcrVerificationCall(verificationId, frontImage, xApiVersion, xCfSignature, _callback); + + } + + public ApiResponse VrsPanOcrVerification(String verificationId, File frontImage, String xApiVersion, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsPanOcrVerificationValidateBeforeCall(verificationId, frontImage, xApiVersion, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsPanVerification + * @param panRequestSchema Find the request parameters to verify whether the PAN information is valid (required) + * @param xApiVersion It is the API version. To receive the aadhaar seeding status in the response, use any date after 2022-09-12 (optional) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifiying PAN information -
400 Validation errors for Verify PAN Sync API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsPanVerificationCall(PanRequestSchema panRequestSchema, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = panRequestSchema; + + // create path and map variables + String localVarPath = "/pan"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsPanVerificationValidateBeforeCall(PanRequestSchema panRequestSchema, String xApiVersion, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'panRequestSchema' is set + if (panRequestSchema == null) { + throw new ApiException("Missing the required parameter 'panRequestSchema' when calling VrsPanVerification(Async)"); + } + + return vrsPanVerificationCall(panRequestSchema, xApiVersion, xCfSignature, _callback); + + } + + public ApiResponse VrsPanVerification(PanRequestSchema panRequestSchema, String xApiVersion, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsPanVerificationValidateBeforeCall(panRequestSchema, xApiVersion, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsPanToGstinVerification + * @param panToGstinRequestSchema Find the request parameters to retrieve the list of GSTIN associated with a PAN (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving the list of GSTIN associated with the entered PAN -
400 Validation errors for PAN to GSTIN API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsPanToGstinVerificationCall(PanToGstinRequestSchema panToGstinRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = panToGstinRequestSchema; + + // create path and map variables + String localVarPath = "/pan-gstin"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsPanToGstinVerificationValidateBeforeCall(PanToGstinRequestSchema panToGstinRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'panToGstinRequestSchema' is set + if (panToGstinRequestSchema == null) { + throw new ApiException("Missing the required parameter 'panToGstinRequestSchema' when calling VrsPanToGstinVerification(Async)"); + } + + return vrsPanToGstinVerificationCall(panToGstinRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsPanToGstinVerification(PanToGstinRequestSchema panToGstinRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsPanToGstinVerificationValidateBeforeCall(panToGstinRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsPassportVerification + * @param passportVerificationRequestSchema Find the request parameter to retrieve your customer's passport information (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieveing passport information -
400 Validation errors for Verify Passport API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsPassportVerificationCall(PassportVerificationRequestSchema passportVerificationRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = passportVerificationRequestSchema; + + // create path and map variables + String localVarPath = "/passport"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsPassportVerificationValidateBeforeCall(PassportVerificationRequestSchema passportVerificationRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passportVerificationRequestSchema' is set + if (passportVerificationRequestSchema == null) { + throw new ApiException("Missing the required parameter 'passportVerificationRequestSchema' when calling VrsPassportVerification(Async)"); + } + + return vrsPassportVerificationCall(passportVerificationRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsPassportVerification(PassportVerificationRequestSchema passportVerificationRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsPassportVerificationValidateBeforeCall(passportVerificationRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsReverseGeocodingVerification + * @param reverseGeocodingRequestSchema Find the request parameters to retrieve the physical address of a location (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving physical address of a location -
400 Validation errors for Reverse Geocoding API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsReverseGeocodingVerificationCall(ReverseGeocodingRequestSchema reverseGeocodingRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = reverseGeocodingRequestSchema; + + // create path and map variables + String localVarPath = "/reverse-geocoding"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsReverseGeocodingVerificationValidateBeforeCall(ReverseGeocodingRequestSchema reverseGeocodingRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'reverseGeocodingRequestSchema' is set + if (reverseGeocodingRequestSchema == null) { + throw new ApiException("Missing the required parameter 'reverseGeocodingRequestSchema' when calling VrsReverseGeocodingVerification(Async)"); + } + + return vrsReverseGeocodingVerificationCall(reverseGeocodingRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsReverseGeocodingVerification(ReverseGeocodingRequestSchema reverseGeocodingRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsReverseGeocodingVerificationValidateBeforeCall(reverseGeocodingRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsReversePennyDropCreateRequest + * @param createRequestRequestSchema Find the request parameters to create a reverse penny drop request (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Success response for creating a reverse penny drop request -
400 Validation errors for Create Request API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal errors -
+ */ + public okhttp3.Call vrsReversePennyDropCreateRequestCall(CreateRequestRequestSchema createRequestRequestSchema, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = createRequestRequestSchema; + + // create path and map variables + String localVarPath = "/reverse-penny-drop"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsReversePennyDropCreateRequestValidateBeforeCall(CreateRequestRequestSchema createRequestRequestSchema, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createRequestRequestSchema' is set + if (createRequestRequestSchema == null) { + throw new ApiException("Missing the required parameter 'createRequestRequestSchema' when calling VrsReversePennyDropCreateRequest(Async)"); + } + + return vrsReversePennyDropCreateRequestCall(createRequestRequestSchema, _callback); + + } + + public ApiResponse VrsReversePennyDropCreateRequest(CreateRequestRequestSchema createRequestRequestSchema, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsReversePennyDropCreateRequestValidateBeforeCall(createRequestRequestSchema, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsReversePennyDropFetchStatus + * @param refId It is the unique ID created by Cashfree Payments that you receive in the response of Create Reverse Penny Drop Request API. (optional, default to 10) + * @param verificationId It is the unique ID created by you to identify the reverse penny drop verification request. (optional, default to 1234) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Success response for retreiving the status of RPD request -
400 Validation errors for Get Details API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
500 Internal error -
+ */ + public okhttp3.Call vrsReversePennyDropFetchStatusCall(String refId, String verificationId, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/remitter/status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (refId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ref_id", refId)); + } + + if (verificationId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verification_id", verificationId)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsReversePennyDropFetchStatusValidateBeforeCall(String refId, String verificationId, final ApiCallback _callback) throws ApiException { + return vrsReversePennyDropFetchStatusCall(refId, verificationId, _callback); + + } + + public ApiResponse VrsReversePennyDropFetchStatus(String refId, String verificationId, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsReversePennyDropFetchStatusValidateBeforeCall(refId, verificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsUpiAdvanceVerification + * @param upiAdvanceRequestSchema Find the request parameters to retrieve the UPI VPA information of your customer (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for verifying UPI VPA information -
400 Validation errors for UPI 360 API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsUpiAdvanceVerificationCall(UpiAdvanceRequestSchema upiAdvanceRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = upiAdvanceRequestSchema; + + // create path and map variables + String localVarPath = "/upi/advance"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsUpiAdvanceVerificationValidateBeforeCall(UpiAdvanceRequestSchema upiAdvanceRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'upiAdvanceRequestSchema' is set + if (upiAdvanceRequestSchema == null) { + throw new ApiException("Missing the required parameter 'upiAdvanceRequestSchema' when calling VrsUpiAdvanceVerification(Async)"); + } + + return vrsUpiAdvanceVerificationCall(upiAdvanceRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsUpiAdvanceVerification(UpiAdvanceRequestSchema upiAdvanceRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsUpiAdvanceVerificationValidateBeforeCall(upiAdvanceRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsUpiMobileVerification + * @param upiMobileRequestSchema Find the request parameters to retrieve the list of UPI VPA associated with the mobile number (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieveing the list of UPI VPA associated with the mobile number -
400 Validation errors for Get UPI VPA with Mobile Number API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
+ */ + public okhttp3.Call vrsUpiMobileVerificationCall(UpiMobileRequestSchema upiMobileRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = upiMobileRequestSchema; + + // create path and map variables + String localVarPath = "/upi/mobile"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsUpiMobileVerificationValidateBeforeCall(UpiMobileRequestSchema upiMobileRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'upiMobileRequestSchema' is set + if (upiMobileRequestSchema == null) { + throw new ApiException("Missing the required parameter 'upiMobileRequestSchema' when calling VrsUpiMobileVerification(Async)"); + } + + return vrsUpiMobileVerificationCall(upiMobileRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsUpiMobileVerification(UpiMobileRequestSchema upiMobileRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsUpiMobileVerificationValidateBeforeCall(upiMobileRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsVehicleRcVerification + * @param vehicleRcRequestSchema Find the request parameters to retrieve the information of a vehicle's registration certificate (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retrieving vehicle's registration certification information -
400 Validation errors for Verify RC API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsVehicleRcVerificationCall(VehicleRcRequestSchema vehicleRcRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = vehicleRcRequestSchema; + + // create path and map variables + String localVarPath = "/vehicle-rc"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsVehicleRcVerificationValidateBeforeCall(VehicleRcRequestSchema vehicleRcRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'vehicleRcRequestSchema' is set + if (vehicleRcRequestSchema == null) { + throw new ApiException("Missing the required parameter 'vehicleRcRequestSchema' when calling VrsVehicleRcVerification(Async)"); + } + + return vrsVehicleRcVerificationCall(vehicleRcRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsVehicleRcVerification(VehicleRcRequestSchema vehicleRcRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsVehicleRcVerificationValidateBeforeCall(vehicleRcRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for vrsVoterIdVerification + * @param voterIdRequestSchema Find the request parameters to fetch voter ID details (required) + * @param xCfSignature Send the signature if IP is not whitelisted (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Success response for retreiving voter ID information -
400 Validation errors for Verify Voter ID API -
401 Invalid client ID and client secret combination -
403 Authentication error (IP not whitelisted) -
409 Conflict error -
422 Validation error because of insufficient balance to process this request -
500 Internal error -
502 Gateway error -
+ */ + public okhttp3.Call vrsVoterIdVerificationCall(VoterIdRequestSchema voterIdRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/verification"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/verification"; + } + + Object localVarPostBody = voterIdRequestSchema; + + // create path and map variables + String localVarPath = "/voter-id"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xCfSignature != null) { + localVarHeaderParams.put("x-cf-signature", localVarApiClient.parameterToString(xCfSignature)); + } + + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientSecret != null) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-1.0.1"); + + String[] localVarAuthNames = new String[] { "XClientSecret", "XClientID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call vrsVoterIdVerificationValidateBeforeCall(VoterIdRequestSchema voterIdRequestSchema, String xCfSignature, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'voterIdRequestSchema' is set + if (voterIdRequestSchema == null) { + throw new ApiException("Missing the required parameter 'voterIdRequestSchema' when calling VrsVoterIdVerification(Async)"); + } + + return vrsVoterIdVerificationCall(voterIdRequestSchema, xCfSignature, _callback); + + } + + public ApiResponse VrsVoterIdVerification(VoterIdRequestSchema voterIdRequestSchema, String xCfSignature, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = vrsVoterIdVerificationValidateBeforeCall(voterIdRequestSchema, xCfSignature, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + + /** + *

ApiClient class.

+ */ +static class ApiClient { + + private String basePath = "https://sandbox.cashfree.com/verification"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://sandbox.cashfree.com/verification", + "Test Server", + new HashMap() + ), + new ServerConfiguration( + "https://api.cashfree.com/verification", + "Production Server", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + 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; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("XClientID", new ApiKeyAuth("header", "x-client-id")); + authentications.put("XClientSecret", new ApiKeyAuth("header", "x-client-secret")); + // 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). + authentications.put("XClientID", new ApiKeyAuth("header", "x-client-id")); + authentications.put("XClientSecret", new ApiKeyAuth("header", "x-client-secret")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + 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); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://sandbox.cashfree.com/verification + * @return An instance of OkHttpClient + */ + 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; + } + + /** + * 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 com.cashfree.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.cashfree.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.cashfree.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.cashfree.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link com.cashfree.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + 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); + } + + + /** + * 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) { + 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) { + throw new RuntimeException("No AWS4 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; + } + + + /** + * 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 || param instanceof OffsetDateTime || param instanceof LocalDate) { + //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(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; + } + + /** + * 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; + } + + /** + * 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 com.cashfree.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 com.cashfree.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 ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) 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 if (obj instanceof String) { + return RequestBody.create((String) obj, 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 com.cashfree.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 com.cashfree.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 com.cashfree.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); + } + } + + /** + * {@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 com.cashfree.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 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 + * @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 com.cashfree.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); + + return httpClient.newCall(request); + } + + /** + * 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 + * @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 com.cashfree.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(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + 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("", contentType == null ? null : 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 baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + 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()) { + // 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 com.cashfree.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(); + 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 { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + 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; + } + } + + /** + * 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. + */ + 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" + (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); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.cashfree.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 ""; + } +} + + public static class PayoutWebhookEvent { + String type; + String rawBody; + Object object; + + PayoutWebhookEvent(String type, String rawBody, Object object) { + this.type = type; + this.rawBody = rawBody; + this.object = object; + } + } + +} diff --git a/src/main/java/com/cashfree/Configuration.java b/src/main/java/com/cashfree/Configuration.java new file mode 100644 index 0000000..cea0c98 --- /dev/null +++ b/src/main/java/com/cashfree/Configuration.java @@ -0,0 +1,41 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +class Configuration { + public static final String VERSION = "1.0.1"; + + private static Cashfree.ApiClient defaultApiClient = new Cashfree.ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static Cashfree.ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(Cashfree.ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/com/cashfree/GzipRequestInterceptor.java b/src/main/java/com/cashfree/GzipRequestInterceptor.java new file mode 100644 index 0000000..707c7bb --- /dev/null +++ b/src/main/java/com/cashfree/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +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/src/main/java/com/cashfree/JSON.java b/src/main/java/com/cashfree/JSON.java new file mode 100644 index 0000000..892ab5a --- /dev/null +++ b/src/main/java/com/cashfree/JSON.java @@ -0,0 +1,496 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AadhaarMaskingResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AadhaarOcrRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AadhaarOcrResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.Aadhaarmaskingrequestschema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AddressDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AddressDetailsSplitAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseUanDetailsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseUanDetailsInnerBasicDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.BadgeDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.BulkPanRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.BulkPanRequestSchemaEntriesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CinRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CinResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CinResponseSchemaDirectorDetailsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateRequestRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateRequestResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DigiLockerVerificationCreateUrlRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DigiLockerVerificationCreateUrlResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DigiLockerVerificationGetDocumentResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DigiLockerVerificationGetStatusResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DigiLockerVerificationGetStatusResponseSchemaUserDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DrivingLicenceDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DrivingLicenceDetailsSplitAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DrivingLicenseRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DrivingLicenseResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DrivingLicenseResponseSchemaDlValidity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DuplicateVerificationId.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationCreateSignatureRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationCreateSignatureRequestSchemaSignersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationCreateSignatureResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationGetStatusResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationGetStatusResponseSchemaSignersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationUploadDocumentRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ESignVerificationUploadDocumentResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ErrorResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.FaceMatchRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.FaceMatchResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.GetPanBulkResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.GetStatusRpdResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.GetVerifyPanResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.GstinRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.GstinResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.GstinResponseSchemaAdditionalAddressArrayInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.InvalidIpAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.Invaliddoctypeschema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.IpVerificationRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.IpVerificationResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.LivelinessRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.LivelinessResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.NameMatchRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.NameMatchResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.OfflineAadhaarSendOtpRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.OfflineAadhaarSendOtpResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.OfflineAadhaarVerifyOtpRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.OfflineAadhaarVerifyOtpResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanAdvanceRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanAdvanceResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanAdvanceResponseSchemaAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanOcrRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanOcrResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanToGstinRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanToGstinResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PanToGstinResponseSchemaGstinListInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PassportVerificationRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PassportVerificationResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PostPanBulkResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ReverseGeocodingRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ReverseGeocodingResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SplitAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SplitAddressSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpiAdvanceRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpiAdvanceResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpiMobileRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpiMobileResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.V2ErrorResponse404SchemaIpVerification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ValidityDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VehicleRcRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VehicleRcResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VoterIdRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VoterIdResponseSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VpaFromPhone500Schema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.XClientIdMissing.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/cashfree/Pair.java b/src/main/java/com/cashfree/Pair.java new file mode 100644 index 0000000..4ad3110 --- /dev/null +++ b/src/main/java/com/cashfree/Pair.java @@ -0,0 +1,57 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/com/cashfree/ProgressRequestBody.java b/src/main/java/com/cashfree/ProgressRequestBody.java new file mode 100644 index 0000000..7e5068e --- /dev/null +++ b/src/main/java/com/cashfree/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +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/src/main/java/com/cashfree/ProgressResponseBody.java b/src/main/java/com/cashfree/ProgressResponseBody.java new file mode 100644 index 0000000..bc7012a --- /dev/null +++ b/src/main/java/com/cashfree/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +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/src/main/java/com/cashfree/ServerConfiguration.java b/src/main/java/com/cashfree/ServerConfiguration.java new file mode 100644 index 0000000..f1cac37 --- /dev/null +++ b/src/main/java/com/cashfree/ServerConfiguration.java @@ -0,0 +1,58 @@ +package com.cashfree; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/com/cashfree/ServerVariable.java b/src/main/java/com/cashfree/ServerVariable.java new file mode 100644 index 0000000..13027d2 --- /dev/null +++ b/src/main/java/com/cashfree/ServerVariable.java @@ -0,0 +1,23 @@ +package com.cashfree; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/com/cashfree/StringUtil.java b/src/main/java/com/cashfree/StringUtil.java new file mode 100644 index 0000000..fe88572 --- /dev/null +++ b/src/main/java/com/cashfree/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/com/cashfree/auth/ApiKeyAuth.java b/src/main/java/com/cashfree/auth/ApiKeyAuth.java new file mode 100644 index 0000000..cec486f --- /dev/null +++ b/src/main/java/com/cashfree/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.auth; + +import com.cashfree.ApiException; +import com.cashfree.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +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/src/main/java/com/cashfree/auth/Authentication.java b/src/main/java/com/cashfree/auth/Authentication.java new file mode 100644 index 0000000..fd34020 --- /dev/null +++ b/src/main/java/com/cashfree/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.auth; + +import com.cashfree.Pair; +import com.cashfree.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/src/main/java/com/cashfree/auth/HttpBasicAuth.java b/src/main/java/com/cashfree/auth/HttpBasicAuth.java new file mode 100644 index 0000000..0dc56f0 --- /dev/null +++ b/src/main/java/com/cashfree/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.auth; + +import com.cashfree.Pair; +import com.cashfree.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/src/main/java/com/cashfree/auth/HttpBearerAuth.java b/src/main/java/com/cashfree/auth/HttpBearerAuth.java new file mode 100644 index 0000000..b6c9732 --- /dev/null +++ b/src/main/java/com/cashfree/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.auth; + +import com.cashfree.ApiException; +import com.cashfree.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +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/src/main/java/com/cashfree/model/AadhaarMaskingResponseSchema.java b/src/main/java/com/cashfree/model/AadhaarMaskingResponseSchema.java new file mode 100644 index 0000000..b1e8e11 --- /dev/null +++ b/src/main/java/com/cashfree/model/AadhaarMaskingResponseSchema.java @@ -0,0 +1,315 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Aadhaar Masking API + */ +@Schema(description = "Success response for Aadhaar Masking API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AadhaarMaskingResponseSchema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_IMAGE_LINK = "image_link"; + @SerializedName(SERIALIZED_NAME_IMAGE_LINK) + private String imageLink; + + public AadhaarMaskingResponseSchema() { + } + + public AadhaarMaskingResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the aadhaar information. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the aadhaar information.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public AadhaarMaskingResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "35476", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public AadhaarMaskingResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public AadhaarMaskingResponseSchema imageLink(String imageLink) { + + this.imageLink = imageLink; + return this; + } + + /** + * It displays the URL of the image. + * @return imageLink + **/ + @javax.annotation.Nullable + @Schema(example = "https://image.url.here", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the URL of the image.") + public String getImageLink() { + return imageLink; + } + + + public void setImageLink(String imageLink) { + this.imageLink = imageLink; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AadhaarMaskingResponseSchema aadhaarMaskingResponseSchema = (AadhaarMaskingResponseSchema) o; + return Objects.equals(this.status, aadhaarMaskingResponseSchema.status) && + Objects.equals(this.referenceId, aadhaarMaskingResponseSchema.referenceId) && + Objects.equals(this.verificationId, aadhaarMaskingResponseSchema.verificationId) && + Objects.equals(this.imageLink, aadhaarMaskingResponseSchema.imageLink); + } + + @Override + public int hashCode() { + return Objects.hash(status, referenceId, verificationId, imageLink); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AadhaarMaskingResponseSchema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" imageLink: ").append(toIndentedString(imageLink)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("image_link"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AadhaarMaskingResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("image_link") != null && !jsonObj.get("image_link").isJsonNull()) && !jsonObj.get("image_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_link").toString())); + } + } + + + /** + * 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 AadhaarMaskingResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("image_link") != null && !jsonObj.get("image_link").isJsonNull()) && !jsonObj.get("image_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_link").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AadhaarMaskingResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AadhaarMaskingResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AadhaarMaskingResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AadhaarMaskingResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AadhaarMaskingResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AadhaarMaskingResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of AadhaarMaskingResponseSchema + * @throws IOException if the JSON string is invalid with respect to AadhaarMaskingResponseSchema + */ + public static AadhaarMaskingResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AadhaarMaskingResponseSchema.class); + } + + /** + * Convert an instance of AadhaarMaskingResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AadhaarOcrRequestSchema.java b/src/main/java/com/cashfree/model/AadhaarOcrRequestSchema.java new file mode 100644 index 0000000..88d3634 --- /dev/null +++ b/src/main/java/com/cashfree/model/AadhaarOcrRequestSchema.java @@ -0,0 +1,291 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body schema for Aadhaar Verification via OCR. + */ +@Schema(description = "Request body schema for Aadhaar Verification via OCR.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AadhaarOcrRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "12345678"; + + public static final String SERIALIZED_NAME_BACK_IMAGE = "back_image"; + @SerializedName(SERIALIZED_NAME_BACK_IMAGE) + private File backImage; + + public static final String SERIALIZED_NAME_FRONT_IMAGE = "front_image"; + @SerializedName(SERIALIZED_NAME_FRONT_IMAGE) + private File frontImage; + + public AadhaarOcrRequestSchema() { + } + + public AadhaarOcrRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * Get verificationId + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "12345678", requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public AadhaarOcrRequestSchema backImage(File backImage) { + + this.backImage = backImage; + return this; + } + + /** + * It is the scanned image of the back of the aadhaar card. Allowed file type - JPEG/JPG/PNG. The max file size of both the files is 10MB. + * @return backImage + **/ + @javax.annotation.Nullable + @Schema(example = "[B@4b62f1ba", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the scanned image of the back of the aadhaar card. Allowed file type - JPEG/JPG/PNG. The max file size of both the files is 10MB.") + public File getBackImage() { + return backImage; + } + + + public void setBackImage(File backImage) { + this.backImage = backImage; + } + + + public AadhaarOcrRequestSchema frontImage(File frontImage) { + + this.frontImage = frontImage; + return this; + } + + /** + * It is the scanned image of the front of the aadhaar card. Allowed file type - JPEG/JPG/PNG. The max file size of both the files is 10MB. + * @return frontImage + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@39dce2df", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the scanned image of the front of the aadhaar card. Allowed file type - JPEG/JPG/PNG. The max file size of both the files is 10MB.") + public File getFrontImage() { + return frontImage; + } + + + public void setFrontImage(File frontImage) { + this.frontImage = frontImage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AadhaarOcrRequestSchema aadhaarOcrRequestSchema = (AadhaarOcrRequestSchema) o; + return Objects.equals(this.verificationId, aadhaarOcrRequestSchema.verificationId) && + Objects.equals(this.backImage, aadhaarOcrRequestSchema.backImage) && + Objects.equals(this.frontImage, aadhaarOcrRequestSchema.frontImage); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, backImage, frontImage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AadhaarOcrRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" backImage: ").append(toIndentedString(backImage)).append("\n"); + sb.append(" frontImage: ").append(toIndentedString(frontImage)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("back_image"); + openapiFields.add("front_image"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("front_image"); + } + + /** + * 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 AadhaarOcrRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AadhaarOcrRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 AadhaarOcrRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AadhaarOcrRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AadhaarOcrRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AadhaarOcrRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AadhaarOcrRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AadhaarOcrRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AadhaarOcrRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AadhaarOcrRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of AadhaarOcrRequestSchema + * @throws IOException if the JSON string is invalid with respect to AadhaarOcrRequestSchema + */ + public static AadhaarOcrRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AadhaarOcrRequestSchema.class); + } + + /** + * Convert an instance of AadhaarOcrRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AadhaarOcrResponseSchema.java b/src/main/java/com/cashfree/model/AadhaarOcrResponseSchema.java new file mode 100644 index 0000000..293032f --- /dev/null +++ b/src/main/java/com/cashfree/model/AadhaarOcrResponseSchema.java @@ -0,0 +1,665 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Aadhaar Verification via OCR + */ +@Schema(description = "Success response for Aadhaar Verification via OCR") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AadhaarOcrResponseSchema { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_YOB = "yob"; + @SerializedName(SERIALIZED_NAME_YOB) + private String yob; + + public static final String SERIALIZED_NAME_FATHER = "father"; + @SerializedName(SERIALIZED_NAME_FATHER) + private String father; + + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private String uid; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_VALID = "valid"; + @SerializedName(SERIALIZED_NAME_VALID) + private Boolean valid; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_CONFIDENCE_SCORE = "confidence_score"; + @SerializedName(SERIALIZED_NAME_CONFIDENCE_SCORE) + private String confidenceScore; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public AadhaarOcrResponseSchema() { + } + + public AadhaarOcrResponseSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the aadhaar card holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the aadhaar card holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public AadhaarOcrResponseSchema yob(String yob) { + + this.yob = yob; + return this; + } + + /** + * It displays the year of birth of the aadhaar card holder. + * @return yob + **/ + @javax.annotation.Nullable + @Schema(example = "2000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the year of birth of the aadhaar card holder.") + public String getYob() { + return yob; + } + + + public void setYob(String yob) { + this.yob = yob; + } + + + public AadhaarOcrResponseSchema father(String father) { + + this.father = father; + return this; + } + + /** + * It displays the father's name of the aadhaar card holder. + * @return father + **/ + @javax.annotation.Nullable + @Schema(example = "Jone Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the father's name of the aadhaar card holder.") + public String getFather() { + return father; + } + + + public void setFather(String father) { + this.father = father; + } + + + public AadhaarOcrResponseSchema gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the aadhaar card holder. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "Male", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the aadhaar card holder.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public AadhaarOcrResponseSchema uid(String uid) { + + this.uid = uid; + return this; + } + + /** + * It displays the UID information as present in the aadhaar card. + * @return uid + **/ + @javax.annotation.Nullable + @Schema(example = "123456789012", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the UID information as present in the aadhaar card.") + public String getUid() { + return uid; + } + + + public void setUid(String uid) { + this.uid = uid; + } + + + public AadhaarOcrResponseSchema state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the name of the state as present in the aadhaar card. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "Madhya Pradesh", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state as present in the aadhaar card.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public AadhaarOcrResponseSchema pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code information as present in the aadhaar card. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "453551", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code information as present in the aadhaar card.") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public AadhaarOcrResponseSchema address(String address) { + + this.address = address; + return this; + } + + /** + * It displays the address information of the aadhaar card holder. + * @return address + **/ + @javax.annotation.Nullable + @Schema(example = "4th cross road Koramangala", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address information of the aadhaar card holder.") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public AadhaarOcrResponseSchema valid(Boolean valid) { + + this.valid = valid; + return this; + } + + /** + * It displays whether the aadhaar card is valid or not. + * @return valid + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the aadhaar card is valid or not.") + public Boolean getValid() { + return valid; + } + + + public void setValid(Boolean valid) { + this.valid = valid; + } + + + public AadhaarOcrResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the aadhaar card. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the aadhaar card.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public AadhaarOcrResponseSchema referenceId(String referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "123456", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public String getReferenceId() { + return referenceId; + } + + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + public AadhaarOcrResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify this request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "123467", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify this request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public AadhaarOcrResponseSchema confidenceScore(String confidenceScore) { + + this.confidenceScore = confidenceScore; + return this; + } + + /** + * It displays the confidence score for this aadhaar card verification request. + * @return confidenceScore + **/ + @javax.annotation.Nullable + @Schema(example = "0.98", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the confidence score for this aadhaar card verification request.") + public String getConfidenceScore() { + return confidenceScore; + } + + + public void setConfidenceScore(String confidenceScore) { + this.confidenceScore = confidenceScore; + } + + + public AadhaarOcrResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "valid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AadhaarOcrResponseSchema aadhaarOcrResponseSchema = (AadhaarOcrResponseSchema) o; + return Objects.equals(this.name, aadhaarOcrResponseSchema.name) && + Objects.equals(this.yob, aadhaarOcrResponseSchema.yob) && + Objects.equals(this.father, aadhaarOcrResponseSchema.father) && + Objects.equals(this.gender, aadhaarOcrResponseSchema.gender) && + Objects.equals(this.uid, aadhaarOcrResponseSchema.uid) && + Objects.equals(this.state, aadhaarOcrResponseSchema.state) && + Objects.equals(this.pincode, aadhaarOcrResponseSchema.pincode) && + Objects.equals(this.address, aadhaarOcrResponseSchema.address) && + Objects.equals(this.valid, aadhaarOcrResponseSchema.valid) && + Objects.equals(this.status, aadhaarOcrResponseSchema.status) && + Objects.equals(this.referenceId, aadhaarOcrResponseSchema.referenceId) && + Objects.equals(this.verificationId, aadhaarOcrResponseSchema.verificationId) && + Objects.equals(this.confidenceScore, aadhaarOcrResponseSchema.confidenceScore) && + Objects.equals(this.message, aadhaarOcrResponseSchema.message); + } + + @Override + public int hashCode() { + return Objects.hash(name, yob, father, gender, uid, state, pincode, address, valid, status, referenceId, verificationId, confidenceScore, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AadhaarOcrResponseSchema {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" yob: ").append(toIndentedString(yob)).append("\n"); + sb.append(" father: ").append(toIndentedString(father)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" confidenceScore: ").append(toIndentedString(confidenceScore)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("yob"); + openapiFields.add("father"); + openapiFields.add("gender"); + openapiFields.add("uid"); + openapiFields.add("state"); + openapiFields.add("pincode"); + openapiFields.add("address"); + openapiFields.add("valid"); + openapiFields.add("status"); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("confidence_score"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AadhaarOcrResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("yob") != null && !jsonObj.get("yob").isJsonNull()) && !jsonObj.get("yob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `yob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("yob").toString())); + } + if ((jsonObj.get("father") != null && !jsonObj.get("father").isJsonNull()) && !jsonObj.get("father").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("uid") != null && !jsonObj.get("uid").isJsonNull()) && !jsonObj.get("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reference_id") != null && !jsonObj.get("reference_id").isJsonNull()) && !jsonObj.get("reference_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference_id").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("confidence_score") != null && !jsonObj.get("confidence_score").isJsonNull()) && !jsonObj.get("confidence_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `confidence_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("confidence_score").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 AadhaarOcrResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("yob") != null && !jsonObj.get("yob").isJsonNull()) && !jsonObj.get("yob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `yob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("yob").toString())); + } + if ((jsonObj.get("father") != null && !jsonObj.get("father").isJsonNull()) && !jsonObj.get("father").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("uid") != null && !jsonObj.get("uid").isJsonNull()) && !jsonObj.get("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reference_id") != null && !jsonObj.get("reference_id").isJsonNull()) && !jsonObj.get("reference_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference_id").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("confidence_score") != null && !jsonObj.get("confidence_score").isJsonNull()) && !jsonObj.get("confidence_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `confidence_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("confidence_score").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AadhaarOcrResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AadhaarOcrResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AadhaarOcrResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AadhaarOcrResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AadhaarOcrResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AadhaarOcrResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of AadhaarOcrResponseSchema + * @throws IOException if the JSON string is invalid with respect to AadhaarOcrResponseSchema + */ + public static AadhaarOcrResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AadhaarOcrResponseSchema.class); + } + + /** + * Convert an instance of AadhaarOcrResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/Aadhaarmaskingrequestschema.java b/src/main/java/com/cashfree/model/Aadhaarmaskingrequestschema.java new file mode 100644 index 0000000..dca6c5b --- /dev/null +++ b/src/main/java/com/cashfree/model/Aadhaarmaskingrequestschema.java @@ -0,0 +1,262 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to mask aadhaar information + */ +@Schema(description = "Find the request parameters to mask aadhaar information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class Aadhaarmaskingrequestschema { + public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) + private File image; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "testverificationid"; + + public Aadhaarmaskingrequestschema() { + } + + public Aadhaarmaskingrequestschema image(File image) { + + this.image = image; + return this; + } + + /** + * It is the image file of the aadhaar card that needs masking. Accepted formats - short, long, and PVC. Allowed file type - JPEG/JPG/PNG. The maximum file size should be 10 MB. + * @return image + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@4b9d2cee", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the image file of the aadhaar card that needs masking. Accepted formats - short, long, and PVC. Allowed file type - JPEG/JPG/PNG. The maximum file size should be 10 MB.") + public File getImage() { + return image; + } + + + public void setImage(File image) { + this.image = image; + } + + + public Aadhaarmaskingrequestschema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Aadhaarmaskingrequestschema aadhaarmaskingrequestschema = (Aadhaarmaskingrequestschema) o; + return Objects.equals(this.image, aadhaarmaskingrequestschema.image) && + Objects.equals(this.verificationId, aadhaarmaskingrequestschema.verificationId); + } + + @Override + public int hashCode() { + return Objects.hash(image, verificationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Aadhaarmaskingrequestschema {\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("image"); + openapiFields.add("verification_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("image"); + openapiRequiredFields.add("verification_id"); + } + + /** + * 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 Aadhaarmaskingrequestschema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Aadhaarmaskingrequestschema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 Aadhaarmaskingrequestschema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Aadhaarmaskingrequestschema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Aadhaarmaskingrequestschema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Aadhaarmaskingrequestschema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Aadhaarmaskingrequestschema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Aadhaarmaskingrequestschema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Aadhaarmaskingrequestschema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Aadhaarmaskingrequestschema given an JSON string + * + * @param jsonString JSON string + * @return An instance of Aadhaarmaskingrequestschema + * @throws IOException if the JSON string is invalid with respect to Aadhaarmaskingrequestschema + */ + public static Aadhaarmaskingrequestschema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Aadhaarmaskingrequestschema.class); + } + + /** + * Convert an instance of Aadhaarmaskingrequestschema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java b/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..e809bcc --- /dev/null +++ b/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java @@ -0,0 +1,148 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import com.cashfree.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + 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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/cashfree/model/AddressDetails.java b/src/main/java/com/cashfree/model/AddressDetails.java new file mode 100644 index 0000000..c702b32 --- /dev/null +++ b/src/main/java/com/cashfree/model/AddressDetails.java @@ -0,0 +1,290 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AddressDetailsSplitAddress; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the address information of the individual. + */ +@Schema(description = "It contains the address information of the individual.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AddressDetails { + public static final String SERIALIZED_NAME_COMPLETE_ADDRESS = "complete_address"; + @SerializedName(SERIALIZED_NAME_COMPLETE_ADDRESS) + private String completeAddress; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_SPLIT_ADDRESS = "split_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_ADDRESS) + private AddressDetailsSplitAddress splitAddress; + + public AddressDetails() { + } + + public AddressDetails completeAddress(String completeAddress) { + + this.completeAddress = completeAddress; + return this; + } + + /** + * It displays the complete address information of the individual. + * @return completeAddress + **/ + @javax.annotation.Nullable + @Schema(example = "S-90 SunTower, GopiNagar, Banaglore, KA - 560109", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the complete address information of the individual.") + public String getCompleteAddress() { + return completeAddress; + } + + + public void setCompleteAddress(String completeAddress) { + this.completeAddress = completeAddress; + } + + + public AddressDetails type(String type) { + + this.type = type; + return this; + } + + /** + * It displays the type of the address information. + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "Permanent/Temporary", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of the address information.") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public AddressDetails splitAddress(AddressDetailsSplitAddress splitAddress) { + + this.splitAddress = splitAddress; + return this; + } + + /** + * Get splitAddress + * @return splitAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AddressDetailsSplitAddress getSplitAddress() { + return splitAddress; + } + + + public void setSplitAddress(AddressDetailsSplitAddress splitAddress) { + this.splitAddress = splitAddress; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddressDetails addressDetails = (AddressDetails) o; + return Objects.equals(this.completeAddress, addressDetails.completeAddress) && + Objects.equals(this.type, addressDetails.type) && + Objects.equals(this.splitAddress, addressDetails.splitAddress); + } + + @Override + public int hashCode() { + return Objects.hash(completeAddress, type, splitAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddressDetails {\n"); + sb.append(" completeAddress: ").append(toIndentedString(completeAddress)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" splitAddress: ").append(toIndentedString(splitAddress)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("complete_address"); + openapiFields.add("type"); + openapiFields.add("split_address"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AddressDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("complete_address") != null && !jsonObj.get("complete_address").isJsonNull()) && !jsonObj.get("complete_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `complete_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("complete_address").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + AddressDetailsSplitAddress.validateJsonElement(jsonObj.get("split_address")); + } + } + + + /** + * 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 AddressDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("complete_address") != null && !jsonObj.get("complete_address").isJsonNull()) && !jsonObj.get("complete_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `complete_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("complete_address").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + AddressDetailsSplitAddress.validateJsonElement(jsonObj.get("split_address")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddressDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddressDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddressDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddressDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddressDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddressDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddressDetails + * @throws IOException if the JSON string is invalid with respect to AddressDetails + */ + public static AddressDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddressDetails.class); + } + + /** + * Convert an instance of AddressDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AddressDetailsSplitAddress.java b/src/main/java/com/cashfree/model/AddressDetailsSplitAddress.java new file mode 100644 index 0000000..c377e3a --- /dev/null +++ b/src/main/java/com/cashfree/model/AddressDetailsSplitAddress.java @@ -0,0 +1,433 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It displays the address information in individual components. + */ +@Schema(description = "It displays the address information in individual components.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AddressDetailsSplitAddress { + public static final String SERIALIZED_NAME_DISTRICT = "district"; + @SerializedName(SERIALIZED_NAME_DISTRICT) + private List district; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private List> state; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private List city; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private List country; + + public static final String SERIALIZED_NAME_ADDRESS_LINE = "address_line"; + @SerializedName(SERIALIZED_NAME_ADDRESS_LINE) + private String addressLine; + + public AddressDetailsSplitAddress() { + } + + public AddressDetailsSplitAddress district(List district) { + + this.district = district; + return this; + } + + public AddressDetailsSplitAddress addDistrictItem(String districtItem) { + if (this.district == null) { + this.district = new ArrayList<>(); + } + this.district.add(districtItem); + return this; + } + + /** + * It displays the name of the district. + * @return district + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the district.") + public List getDistrict() { + return district; + } + + + public void setDistrict(List district) { + this.district = district; + } + + + public AddressDetailsSplitAddress state(List> state) { + + this.state = state; + return this; + } + + public AddressDetailsSplitAddress addStateItem(List stateItem) { + if (this.state == null) { + this.state = new ArrayList<>(); + } + this.state.add(stateItem); + return this; + } + + /** + * It displays the name of the state. + * @return state + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state.") + public List> getState() { + return state; + } + + + public void setState(List> state) { + this.state = state; + } + + + public AddressDetailsSplitAddress city(List city) { + + this.city = city; + return this; + } + + public AddressDetailsSplitAddress addCityItem(String cityItem) { + if (this.city == null) { + this.city = new ArrayList<>(); + } + this.city.add(cityItem); + return this; + } + + /** + * It displays the name of the city. + * @return city + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the city.") + public List getCity() { + return city; + } + + + public void setCity(List city) { + this.city = city; + } + + + public AddressDetailsSplitAddress pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code information. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "560109", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code information.") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public AddressDetailsSplitAddress country(List country) { + + this.country = country; + return this; + } + + public AddressDetailsSplitAddress addCountryItem(String countryItem) { + if (this.country == null) { + this.country = new ArrayList<>(); + } + this.country.add(countryItem); + return this; + } + + /** + * It displays the name of the country. + * @return country + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the country.") + public List getCountry() { + return country; + } + + + public void setCountry(List country) { + this.country = country; + } + + + public AddressDetailsSplitAddress addressLine(String addressLine) { + + this.addressLine = addressLine; + return this; + } + + /** + * It displays the address information. + * @return addressLine + **/ + @javax.annotation.Nullable + @Schema(example = "S-90 SunTower, GopiNagar, Banaglore, KA - 560109", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address information.") + public String getAddressLine() { + return addressLine; + } + + + public void setAddressLine(String addressLine) { + this.addressLine = addressLine; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddressDetailsSplitAddress addressDetailsSplitAddress = (AddressDetailsSplitAddress) o; + return Objects.equals(this.district, addressDetailsSplitAddress.district) && + Objects.equals(this.state, addressDetailsSplitAddress.state) && + Objects.equals(this.city, addressDetailsSplitAddress.city) && + Objects.equals(this.pincode, addressDetailsSplitAddress.pincode) && + Objects.equals(this.country, addressDetailsSplitAddress.country) && + Objects.equals(this.addressLine, addressDetailsSplitAddress.addressLine); + } + + @Override + public int hashCode() { + return Objects.hash(district, state, city, pincode, country, addressLine); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddressDetailsSplitAddress {\n"); + sb.append(" district: ").append(toIndentedString(district)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" addressLine: ").append(toIndentedString(addressLine)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("district"); + openapiFields.add("state"); + openapiFields.add("city"); + openapiFields.add("pincode"); + openapiFields.add("country"); + openapiFields.add("address_line"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AddressDetailsSplitAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + } + + + /** + * 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 AddressDetailsSplitAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddressDetailsSplitAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddressDetailsSplitAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddressDetailsSplitAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddressDetailsSplitAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddressDetailsSplitAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddressDetailsSplitAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddressDetailsSplitAddress + * @throws IOException if the JSON string is invalid with respect to AddressDetailsSplitAddress + */ + public static AddressDetailsSplitAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddressDetailsSplitAddress.class); + } + + /** + * Convert an instance of AddressDetailsSplitAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentRequestSchema.java b/src/main/java/com/cashfree/model/AdvanceEmploymentRequestSchema.java new file mode 100644 index 0000000..0dd0676 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentRequestSchema.java @@ -0,0 +1,436 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.time.LocalDate; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to retrieve employment infomration + */ +@Schema(description = "Find the request parameters to retrieve employment infomration") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_UAN = "uan"; + @SerializedName(SERIALIZED_NAME_UAN) + private String uan; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private LocalDate dob; + + public static final String SERIALIZED_NAME_EMPLOYEE_NAME = "employee_name"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME) + private String employeeName; + + public static final String SERIALIZED_NAME_EMPLOYER_NAME = "employer_name"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_NAME) + private String employerName; + + public AdvanceEmploymentRequestSchema() { + } + + public AdvanceEmploymentRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the API request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the API request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public AdvanceEmploymentRequestSchema phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * It is the phone number of the employee. (conditonal mandatory) + * @return phone + **/ + @javax.annotation.Nullable + @Schema(example = "9988776655", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the phone number of the employee. (conditonal mandatory)") + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public AdvanceEmploymentRequestSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It is the PAN information of the employee. (conditonal mandatory) + * @return pan + **/ + @javax.annotation.Nullable + @Schema(example = "AZJPG7110R", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the PAN information of the employee. (conditonal mandatory)") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public AdvanceEmploymentRequestSchema uan(String uan) { + + this.uan = uan; + return this; + } + + /** + * It is the unique number assigned to every employee contributing to the Employees' Provident Fund (EPF).(conditonal mandatory) + * @return uan + **/ + @javax.annotation.Nullable + @Schema(example = "101340612345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the unique number assigned to every employee contributing to the Employees' Provident Fund (EPF).(conditonal mandatory)") + public String getUan() { + return uan; + } + + + public void setUan(String uan) { + this.uan = uan; + } + + + public AdvanceEmploymentRequestSchema dob(LocalDate dob) { + + this.dob = dob; + return this; + } + + /** + * It is the date of birth information of the employee. The format is YYYY-MM-DD.Employee date of birth (conditonal mandatory) + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "Fri Nov 10 00:00:00 UTC 1995", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the date of birth information of the employee. The format is YYYY-MM-DD.Employee date of birth (conditonal mandatory)") + public LocalDate getDob() { + return dob; + } + + + public void setDob(LocalDate dob) { + this.dob = dob; + } + + + public AdvanceEmploymentRequestSchema employeeName(String employeeName) { + + this.employeeName = employeeName; + return this; + } + + /** + * It is the name of the employee. (conditonal mandatory) + * @return employeeName + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the employee. (conditonal mandatory)") + public String getEmployeeName() { + return employeeName; + } + + + public void setEmployeeName(String employeeName) { + this.employeeName = employeeName; + } + + + public AdvanceEmploymentRequestSchema employerName(String employerName) { + + this.employerName = employerName; + return this; + } + + /** + * It is the name of the employer. (conditonal mandatory) + * @return employerName + **/ + @javax.annotation.Nullable + @Schema(example = "Cashfree India Pvt Ltd", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the employer. (conditonal mandatory)") + public String getEmployerName() { + return employerName; + } + + + public void setEmployerName(String employerName) { + this.employerName = employerName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentRequestSchema advanceEmploymentRequestSchema = (AdvanceEmploymentRequestSchema) o; + return Objects.equals(this.verificationId, advanceEmploymentRequestSchema.verificationId) && + Objects.equals(this.phone, advanceEmploymentRequestSchema.phone) && + Objects.equals(this.pan, advanceEmploymentRequestSchema.pan) && + Objects.equals(this.uan, advanceEmploymentRequestSchema.uan) && + Objects.equals(this.dob, advanceEmploymentRequestSchema.dob) && + Objects.equals(this.employeeName, advanceEmploymentRequestSchema.employeeName) && + Objects.equals(this.employerName, advanceEmploymentRequestSchema.employerName); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, phone, pan, uan, dob, employeeName, employerName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" uan: ").append(toIndentedString(uan)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" employeeName: ").append(toIndentedString(employeeName)).append("\n"); + sb.append(" employerName: ").append(toIndentedString(employerName)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("phone"); + openapiFields.add("pan"); + openapiFields.add("uan"); + openapiFields.add("dob"); + openapiFields.add("employee_name"); + openapiFields.add("employer_name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + } + + /** + * 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 AdvanceEmploymentRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AdvanceEmploymentRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + if ((jsonObj.get("employee_name") != null && !jsonObj.get("employee_name").isJsonNull()) && !jsonObj.get("employee_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_name").toString())); + } + if ((jsonObj.get("employer_name") != null && !jsonObj.get("employer_name").isJsonNull()) && !jsonObj.get("employer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employer_name").toString())); + } + } + + + /** + * 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 AdvanceEmploymentRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AdvanceEmploymentRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + if ((jsonObj.get("employee_name") != null && !jsonObj.get("employee_name").isJsonNull()) && !jsonObj.get("employee_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_name").toString())); + } + if ((jsonObj.get("employer_name") != null && !jsonObj.get("employer_name").isJsonNull()) && !jsonObj.get("employer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employer_name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentRequestSchema + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentRequestSchema + */ + public static AdvanceEmploymentRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentRequestSchema.class); + } + + /** + * Convert an instance of AdvanceEmploymentRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponse.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponse.java new file mode 100644 index 0000000..024e729 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponse.java @@ -0,0 +1,426 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AdvanceEmploymentResponseInput; +import com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetails; +import com.cashfree.model.AdvanceEmploymentResponseUanDetailsInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Get Employment Details + */ +@Schema(description = "Success response for Get Employment Details") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponse { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private AdvanceEmploymentResponseInput input; + + public static final String SERIALIZED_NAME_UAN_DETAILS = "uan_details"; + @SerializedName(SERIALIZED_NAME_UAN_DETAILS) + private List uanDetails; + + public static final String SERIALIZED_NAME_RECENT_EMPLOYMENT_DETAILS = "recent_employment_details"; + @SerializedName(SERIALIZED_NAME_RECENT_EMPLOYMENT_DETAILS) + private AdvanceEmploymentResponseRecentEmploymentDetails recentEmploymentDetails; + + public AdvanceEmploymentResponse() { + } + + public AdvanceEmploymentResponse verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public AdvanceEmploymentResponse referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public AdvanceEmploymentResponse status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public AdvanceEmploymentResponse input(AdvanceEmploymentResponseInput input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseInput getInput() { + return input; + } + + + public void setInput(AdvanceEmploymentResponseInput input) { + this.input = input; + } + + + public AdvanceEmploymentResponse uanDetails(List uanDetails) { + + this.uanDetails = uanDetails; + return this; + } + + public AdvanceEmploymentResponse addUanDetailsItem(AdvanceEmploymentResponseUanDetailsInner uanDetailsItem) { + if (this.uanDetails == null) { + this.uanDetails = new ArrayList<>(); + } + this.uanDetails.add(uanDetailsItem); + return this; + } + + /** + * It contains the UAN information. + * @return uanDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It contains the UAN information.") + public List getUanDetails() { + return uanDetails; + } + + + public void setUanDetails(List uanDetails) { + this.uanDetails = uanDetails; + } + + + public AdvanceEmploymentResponse recentEmploymentDetails(AdvanceEmploymentResponseRecentEmploymentDetails recentEmploymentDetails) { + + this.recentEmploymentDetails = recentEmploymentDetails; + return this; + } + + /** + * Get recentEmploymentDetails + * @return recentEmploymentDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseRecentEmploymentDetails getRecentEmploymentDetails() { + return recentEmploymentDetails; + } + + + public void setRecentEmploymentDetails(AdvanceEmploymentResponseRecentEmploymentDetails recentEmploymentDetails) { + this.recentEmploymentDetails = recentEmploymentDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponse advanceEmploymentResponse = (AdvanceEmploymentResponse) o; + return Objects.equals(this.verificationId, advanceEmploymentResponse.verificationId) && + Objects.equals(this.referenceId, advanceEmploymentResponse.referenceId) && + Objects.equals(this.status, advanceEmploymentResponse.status) && + Objects.equals(this.input, advanceEmploymentResponse.input) && + Objects.equals(this.uanDetails, advanceEmploymentResponse.uanDetails) && + Objects.equals(this.recentEmploymentDetails, advanceEmploymentResponse.recentEmploymentDetails); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, referenceId, status, input, uanDetails, recentEmploymentDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponse {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" uanDetails: ").append(toIndentedString(uanDetails)).append("\n"); + sb.append(" recentEmploymentDetails: ").append(toIndentedString(recentEmploymentDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("status"); + openapiFields.add("input"); + openapiFields.add("uan_details"); + openapiFields.add("recent_employment_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `input` + if (jsonObj.get("input") != null && !jsonObj.get("input").isJsonNull()) { + AdvanceEmploymentResponseInput.validateJsonElement(jsonObj.get("input")); + } + if (jsonObj.get("uan_details") != null && !jsonObj.get("uan_details").isJsonNull()) { + JsonArray jsonArrayuanDetails = jsonObj.getAsJsonArray("uan_details"); + if (jsonArrayuanDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("uan_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uan_details` to be an array in the JSON string but got `%s`", jsonObj.get("uan_details").toString())); + } + + // validate the optional field `uan_details` (array) + for (int i = 0; i < jsonArrayuanDetails.size(); i++) { + AdvanceEmploymentResponseUanDetailsInner.validateJsonElement(jsonArrayuanDetails.get(i)); + }; + } + } + // validate the optional field `recent_employment_details` + if (jsonObj.get("recent_employment_details") != null && !jsonObj.get("recent_employment_details").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetails.validateJsonElement(jsonObj.get("recent_employment_details")); + } + } + + + /** + * 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 AdvanceEmploymentResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `input` + if (jsonObj.get("input") != null && !jsonObj.get("input").isJsonNull()) { + AdvanceEmploymentResponseInput.validateJsonElement(jsonObj.get("input")); + return true; + } + if (jsonObj.get("uan_details") != null && !jsonObj.get("uan_details").isJsonNull()) { + JsonArray jsonArrayuanDetails = jsonObj.getAsJsonArray("uan_details"); + if (jsonArrayuanDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("uan_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uan_details` to be an array in the JSON string but got `%s`", jsonObj.get("uan_details").toString())); + } + + // validate the optional field `uan_details` (array) + for (int i = 0; i < jsonArrayuanDetails.size(); i++) { + AdvanceEmploymentResponseUanDetailsInner.validateJsonElement(jsonArrayuanDetails.get(i)); + }; + } + } + // validate the optional field `recent_employment_details` + if (jsonObj.get("recent_employment_details") != null && !jsonObj.get("recent_employment_details").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetails.validateJsonElement(jsonObj.get("recent_employment_details")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponse + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponse + */ + public static AdvanceEmploymentResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponse.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseInput.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseInput.java new file mode 100644 index 0000000..35bb482 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseInput.java @@ -0,0 +1,391 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the information entered in the API request. + */ +@Schema(description = "It contains the information entered in the API request.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseInput { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_UAN = "uan"; + @SerializedName(SERIALIZED_NAME_UAN) + private String uan; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_EMPLOYEE_NAME = "employee_name"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME) + private String employeeName; + + public static final String SERIALIZED_NAME_EMPLOYER_NAME = "employer_name"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_NAME) + private String employerName; + + public AdvanceEmploymentResponseInput() { + } + + public AdvanceEmploymentResponseInput phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * It displays the phone number of the employee. + * @return phone + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the phone number of the employee.") + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public AdvanceEmploymentResponseInput pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It displays the PAN information of the employee. + * @return pan + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PAN information of the employee.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public AdvanceEmploymentResponseInput uan(String uan) { + + this.uan = uan; + return this; + } + + /** + * It displays the UAN information of the employee. + * @return uan + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the UAN information of the employee.") + public String getUan() { + return uan; + } + + + public void setUan(String uan) { + this.uan = uan; + } + + + public AdvanceEmploymentResponseInput dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the employee. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "1996-10-02", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the employee.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public AdvanceEmploymentResponseInput employeeName(String employeeName) { + + this.employeeName = employeeName; + return this; + } + + /** + * It displays the name of the employee. + * @return employeeName + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the employee.") + public String getEmployeeName() { + return employeeName; + } + + + public void setEmployeeName(String employeeName) { + this.employeeName = employeeName; + } + + + public AdvanceEmploymentResponseInput employerName(String employerName) { + + this.employerName = employerName; + return this; + } + + /** + * It displays the name of the employer. + * @return employerName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the employer.") + public String getEmployerName() { + return employerName; + } + + + public void setEmployerName(String employerName) { + this.employerName = employerName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseInput advanceEmploymentResponseInput = (AdvanceEmploymentResponseInput) o; + return Objects.equals(this.phone, advanceEmploymentResponseInput.phone) && + Objects.equals(this.pan, advanceEmploymentResponseInput.pan) && + Objects.equals(this.uan, advanceEmploymentResponseInput.uan) && + Objects.equals(this.dob, advanceEmploymentResponseInput.dob) && + Objects.equals(this.employeeName, advanceEmploymentResponseInput.employeeName) && + Objects.equals(this.employerName, advanceEmploymentResponseInput.employerName); + } + + @Override + public int hashCode() { + return Objects.hash(phone, pan, uan, dob, employeeName, employerName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseInput {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" uan: ").append(toIndentedString(uan)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" employeeName: ").append(toIndentedString(employeeName)).append("\n"); + sb.append(" employerName: ").append(toIndentedString(employerName)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("phone"); + openapiFields.add("pan"); + openapiFields.add("uan"); + openapiFields.add("dob"); + openapiFields.add("employee_name"); + openapiFields.add("employer_name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("employee_name") != null && !jsonObj.get("employee_name").isJsonNull()) && !jsonObj.get("employee_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_name").toString())); + } + if ((jsonObj.get("employer_name") != null && !jsonObj.get("employer_name").isJsonNull()) && !jsonObj.get("employer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employer_name").toString())); + } + } + + + /** + * 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 AdvanceEmploymentResponseInput + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("employee_name") != null && !jsonObj.get("employee_name").isJsonNull()) && !jsonObj.get("employee_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_name").toString())); + } + if ((jsonObj.get("employer_name") != null && !jsonObj.get("employer_name").isJsonNull()) && !jsonObj.get("employer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employer_name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseInput.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseInput value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseInput + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseInput + */ + public static AdvanceEmploymentResponseInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseInput.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetails.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetails.java new file mode 100644 index 0000000..b71efa9 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetails.java @@ -0,0 +1,259 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails; +import com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the employment details of the individual. + */ +@Schema(description = "It contains the employment details of the individual.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseRecentEmploymentDetails { + public static final String SERIALIZED_NAME_EMPLOYEE_DETAILS = "employee_details"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_DETAILS) + private AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails employeeDetails; + + public static final String SERIALIZED_NAME_EMPLOYER_DETAILS = "employer_details"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_DETAILS) + private AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails employerDetails; + + public AdvanceEmploymentResponseRecentEmploymentDetails() { + } + + public AdvanceEmploymentResponseRecentEmploymentDetails employeeDetails(AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails employeeDetails) { + + this.employeeDetails = employeeDetails; + return this; + } + + /** + * Get employeeDetails + * @return employeeDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails getEmployeeDetails() { + return employeeDetails; + } + + + public void setEmployeeDetails(AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails employeeDetails) { + this.employeeDetails = employeeDetails; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetails employerDetails(AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails employerDetails) { + + this.employerDetails = employerDetails; + return this; + } + + /** + * Get employerDetails + * @return employerDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails getEmployerDetails() { + return employerDetails; + } + + + public void setEmployerDetails(AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails employerDetails) { + this.employerDetails = employerDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseRecentEmploymentDetails advanceEmploymentResponseRecentEmploymentDetails = (AdvanceEmploymentResponseRecentEmploymentDetails) o; + return Objects.equals(this.employeeDetails, advanceEmploymentResponseRecentEmploymentDetails.employeeDetails) && + Objects.equals(this.employerDetails, advanceEmploymentResponseRecentEmploymentDetails.employerDetails); + } + + @Override + public int hashCode() { + return Objects.hash(employeeDetails, employerDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseRecentEmploymentDetails {\n"); + sb.append(" employeeDetails: ").append(toIndentedString(employeeDetails)).append("\n"); + sb.append(" employerDetails: ").append(toIndentedString(employerDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("employee_details"); + openapiFields.add("employer_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `employee_details` + if (jsonObj.get("employee_details") != null && !jsonObj.get("employee_details").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.validateJsonElement(jsonObj.get("employee_details")); + } + // validate the optional field `employer_details` + if (jsonObj.get("employer_details") != null && !jsonObj.get("employer_details").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.validateJsonElement(jsonObj.get("employer_details")); + } + } + + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `employee_details` + if (jsonObj.get("employee_details") != null && !jsonObj.get("employee_details").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.validateJsonElement(jsonObj.get("employee_details")); + return true; + } + // validate the optional field `employer_details` + if (jsonObj.get("employer_details") != null && !jsonObj.get("employer_details").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.validateJsonElement(jsonObj.get("employer_details")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseRecentEmploymentDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseRecentEmploymentDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseRecentEmploymentDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseRecentEmploymentDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseRecentEmploymentDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseRecentEmploymentDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseRecentEmploymentDetails + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseRecentEmploymentDetails + */ + public static AdvanceEmploymentResponseRecentEmploymentDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseRecentEmploymentDetails.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseRecentEmploymentDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.java new file mode 100644 index 0000000..0f30f29 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.java @@ -0,0 +1,447 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the details of the individual as an employee. + */ +@Schema(description = "It contains the details of the individual as an employee.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails { + public static final String SERIALIZED_NAME_MEMBER_ID = "member_id"; + @SerializedName(SERIALIZED_NAME_MEMBER_ID) + private String memberId; + + public static final String SERIALIZED_NAME_EXIT_DATE = "exit_date"; + @SerializedName(SERIALIZED_NAME_EXIT_DATE) + private String exitDate; + + public static final String SERIALIZED_NAME_JOINING_DATE = "joining_date"; + @SerializedName(SERIALIZED_NAME_JOINING_DATE) + private String joiningDate; + + public static final String SERIALIZED_NAME_UAN = "uan"; + @SerializedName(SERIALIZED_NAME_UAN) + private String uan; + + public static final String SERIALIZED_NAME_EPFO = "epfo"; + @SerializedName(SERIALIZED_NAME_EPFO) + private AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo epfo; + + public static final String SERIALIZED_NAME_EMPLOYED = "employed"; + @SerializedName(SERIALIZED_NAME_EMPLOYED) + private Boolean employed; + + public static final String SERIALIZED_NAME_EMPLOYEE_NAME_MATCH = "employee_name_match"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME_MATCH) + private Boolean employeeNameMatch; + + public static final String SERIALIZED_NAME_EXIT_DATE_MARKED = "exit_date_marked"; + @SerializedName(SERIALIZED_NAME_EXIT_DATE_MARKED) + private Boolean exitDateMarked; + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails() { + } + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails memberId(String memberId) { + + this.memberId = memberId; + return this; + } + + /** + * It displays the unique ID assigned to an individual. + * @return memberId + **/ + @javax.annotation.Nullable + @Schema(example = "UPLKO22417520000010171", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID assigned to an individual.") + public String getMemberId() { + return memberId; + } + + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails exitDate(String exitDate) { + + this.exitDate = exitDate; + return this; + } + + /** + * It displays the last working day of the employee in the organisation. + * @return exitDate + **/ + @javax.annotation.Nullable + @Schema(example = "2024-11-01", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the last working day of the employee in the organisation.") + public String getExitDate() { + return exitDate; + } + + + public void setExitDate(String exitDate) { + this.exitDate = exitDate; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails joiningDate(String joiningDate) { + + this.joiningDate = joiningDate; + return this; + } + + /** + * It displays the first working day of the employee in the organisation. + * @return joiningDate + **/ + @javax.annotation.Nullable + @Schema(example = "2023-09-01", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the first working day of the employee in the organisation.") + public String getJoiningDate() { + return joiningDate; + } + + + public void setJoiningDate(String joiningDate) { + this.joiningDate = joiningDate; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails uan(String uan) { + + this.uan = uan; + return this; + } + + /** + * It displays the Universal Account Number (UAN) information of the employee. + * @return uan + **/ + @javax.annotation.Nullable + @Schema(example = "101379636551", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the Universal Account Number (UAN) information of the employee.") + public String getUan() { + return uan; + } + + + public void setUan(String uan) { + this.uan = uan; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails epfo(AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo epfo) { + + this.epfo = epfo; + return this; + } + + /** + * Get epfo + * @return epfo + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo getEpfo() { + return epfo; + } + + + public void setEpfo(AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo epfo) { + this.epfo = epfo; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails employed(Boolean employed) { + + this.employed = employed; + return this; + } + + /** + * It displays whether the individual is employed. + * @return employed + **/ + @javax.annotation.Nullable + @Schema(example = "false", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the individual is employed.") + public Boolean getEmployed() { + return employed; + } + + + public void setEmployed(Boolean employed) { + this.employed = employed; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails employeeNameMatch(Boolean employeeNameMatch) { + + this.employeeNameMatch = employeeNameMatch; + return this; + } + + /** + * It displays whether the individual's name matches with the name found in EPFO. + * @return employeeNameMatch + **/ + @javax.annotation.Nullable + @Schema(example = "false", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the individual's name matches with the name found in EPFO.") + public Boolean getEmployeeNameMatch() { + return employeeNameMatch; + } + + + public void setEmployeeNameMatch(Boolean employeeNameMatch) { + this.employeeNameMatch = employeeNameMatch; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails exitDateMarked(Boolean exitDateMarked) { + + this.exitDateMarked = exitDateMarked; + return this; + } + + /** + * It displays whether the last working + * @return exitDateMarked + **/ + @javax.annotation.Nullable + @Schema(example = "false", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the last working ") + public Boolean getExitDateMarked() { + return exitDateMarked; + } + + + public void setExitDateMarked(Boolean exitDateMarked) { + this.exitDateMarked = exitDateMarked; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails = (AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails) o; + return Objects.equals(this.memberId, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.memberId) && + Objects.equals(this.exitDate, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.exitDate) && + Objects.equals(this.joiningDate, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.joiningDate) && + Objects.equals(this.uan, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.uan) && + Objects.equals(this.epfo, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.epfo) && + Objects.equals(this.employed, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.employed) && + Objects.equals(this.employeeNameMatch, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.employeeNameMatch) && + Objects.equals(this.exitDateMarked, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.exitDateMarked); + } + + @Override + public int hashCode() { + return Objects.hash(memberId, exitDate, joiningDate, uan, epfo, employed, employeeNameMatch, exitDateMarked); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails {\n"); + sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); + sb.append(" exitDate: ").append(toIndentedString(exitDate)).append("\n"); + sb.append(" joiningDate: ").append(toIndentedString(joiningDate)).append("\n"); + sb.append(" uan: ").append(toIndentedString(uan)).append("\n"); + sb.append(" epfo: ").append(toIndentedString(epfo)).append("\n"); + sb.append(" employed: ").append(toIndentedString(employed)).append("\n"); + sb.append(" employeeNameMatch: ").append(toIndentedString(employeeNameMatch)).append("\n"); + sb.append(" exitDateMarked: ").append(toIndentedString(exitDateMarked)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("member_id"); + openapiFields.add("exit_date"); + openapiFields.add("joining_date"); + openapiFields.add("uan"); + openapiFields.add("epfo"); + openapiFields.add("employed"); + openapiFields.add("employee_name_match"); + openapiFields.add("exit_date_marked"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("member_id") != null && !jsonObj.get("member_id").isJsonNull()) && !jsonObj.get("member_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `member_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("member_id").toString())); + } + if ((jsonObj.get("exit_date") != null && !jsonObj.get("exit_date").isJsonNull()) && !jsonObj.get("exit_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exit_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exit_date").toString())); + } + if ((jsonObj.get("joining_date") != null && !jsonObj.get("joining_date").isJsonNull()) && !jsonObj.get("joining_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `joining_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("joining_date").toString())); + } + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + // validate the optional field `epfo` + if (jsonObj.get("epfo") != null && !jsonObj.get("epfo").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.validateJsonElement(jsonObj.get("epfo")); + } + } + + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("member_id") != null && !jsonObj.get("member_id").isJsonNull()) && !jsonObj.get("member_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `member_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("member_id").toString())); + } + if ((jsonObj.get("exit_date") != null && !jsonObj.get("exit_date").isJsonNull()) && !jsonObj.get("exit_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exit_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exit_date").toString())); + } + if ((jsonObj.get("joining_date") != null && !jsonObj.get("joining_date").isJsonNull()) && !jsonObj.get("joining_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `joining_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("joining_date").toString())); + } + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + // validate the optional field `epfo` + if (jsonObj.get("epfo") != null && !jsonObj.get("epfo").isJsonNull()) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.validateJsonElement(jsonObj.get("epfo")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails + */ + public static AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.java new file mode 100644 index 0000000..b7c2a36 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.java @@ -0,0 +1,268 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the information found in Employees' Provident Fund Organisation (EPFO) + */ +@Schema(description = "It contains the information found in Employees' Provident Fund Organisation (EPFO)") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo { + public static final String SERIALIZED_NAME_RECENT = "recent"; + @SerializedName(SERIALIZED_NAME_RECENT) + private Boolean recent; + + public static final String SERIALIZED_NAME_NAME_UNIQUE = "name_unique"; + @SerializedName(SERIALIZED_NAME_NAME_UNIQUE) + private Boolean nameUnique; + + public static final String SERIALIZED_NAME_PF_FILINGS_DETAILS = "pf_filings_details"; + @SerializedName(SERIALIZED_NAME_PF_FILINGS_DETAILS) + private Boolean pfFilingsDetails; + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo() { + } + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo recent(Boolean recent) { + + this.recent = recent; + return this; + } + + /** + * It displays whether the retrieved information is recent. + * @return recent + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the retrieved information is recent.") + public Boolean getRecent() { + return recent; + } + + + public void setRecent(Boolean recent) { + this.recent = recent; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo nameUnique(Boolean nameUnique) { + + this.nameUnique = nameUnique; + return this; + } + + /** + * It displays whether the retrieved name is unique. + * @return nameUnique + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the retrieved name is unique.") + public Boolean getNameUnique() { + return nameUnique; + } + + + public void setNameUnique(Boolean nameUnique) { + this.nameUnique = nameUnique; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo pfFilingsDetails(Boolean pfFilingsDetails) { + + this.pfFilingsDetails = pfFilingsDetails; + return this; + } + + /** + * It displays whether the PF filing details are true. + * @return pfFilingsDetails + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the PF filing details are true.") + public Boolean getPfFilingsDetails() { + return pfFilingsDetails; + } + + + public void setPfFilingsDetails(Boolean pfFilingsDetails) { + this.pfFilingsDetails = pfFilingsDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo = (AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo) o; + return Objects.equals(this.recent, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.recent) && + Objects.equals(this.nameUnique, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.nameUnique) && + Objects.equals(this.pfFilingsDetails, advanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.pfFilingsDetails); + } + + @Override + public int hashCode() { + return Objects.hash(recent, nameUnique, pfFilingsDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo {\n"); + sb.append(" recent: ").append(toIndentedString(recent)).append("\n"); + sb.append(" nameUnique: ").append(toIndentedString(nameUnique)).append("\n"); + sb.append(" pfFilingsDetails: ").append(toIndentedString(pfFilingsDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("recent"); + openapiFields.add("name_unique"); + openapiFields.add("pf_filings_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo + */ + public static AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployeeDetailsEpfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.java new file mode 100644 index 0000000..042cf05 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.java @@ -0,0 +1,447 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails { + public static final String SERIALIZED_NAME_ESTABLISHMENT_ID = "establishment_id"; + @SerializedName(SERIALIZED_NAME_ESTABLISHMENT_ID) + private String establishmentId; + + public static final String SERIALIZED_NAME_ESTABLISHMENT_NAME = "establishment_name"; + @SerializedName(SERIALIZED_NAME_ESTABLISHMENT_NAME) + private String establishmentName; + + public static final String SERIALIZED_NAME_SETUP_DATE = "setup_date"; + @SerializedName(SERIALIZED_NAME_SETUP_DATE) + private String setupDate; + + public static final String SERIALIZED_NAME_OWNERSHIP_TYPE = "ownership_type"; + @SerializedName(SERIALIZED_NAME_OWNERSHIP_TYPE) + private String ownershipType; + + public static final String SERIALIZED_NAME_EMPLOYER_CONFIDENCE_SCORE = "employer_confidence_score"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_CONFIDENCE_SCORE) + private BigDecimal employerConfidenceScore; + + public static final String SERIALIZED_NAME_EMPLOYER_NAME_MATCH = "employer_name_match"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_NAME_MATCH) + private Boolean employerNameMatch; + + public static final String SERIALIZED_NAME_PF_FILING_DETAILS = "pf_filing_details"; + @SerializedName(SERIALIZED_NAME_PF_FILING_DETAILS) + private List pfFilingDetails; + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails() { + } + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails establishmentId(String establishmentId) { + + this.establishmentId = establishmentId; + return this; + } + + /** + * Get establishmentId + * @return establishmentId + **/ + @javax.annotation.Nullable + @Schema(example = "MHBAN1234220000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getEstablishmentId() { + return establishmentId; + } + + + public void setEstablishmentId(String establishmentId) { + this.establishmentId = establishmentId; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails establishmentName(String establishmentName) { + + this.establishmentName = establishmentName; + return this; + } + + /** + * Get establishmentName + * @return establishmentName + **/ + @javax.annotation.Nullable + @Schema(example = "Cashfree India Private Ltd", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getEstablishmentName() { + return establishmentName; + } + + + public void setEstablishmentName(String establishmentName) { + this.establishmentName = establishmentName; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails setupDate(String setupDate) { + + this.setupDate = setupDate; + return this; + } + + /** + * Get setupDate + * @return setupDate + **/ + @javax.annotation.Nullable + @Schema(example = "2020-11-19", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getSetupDate() { + return setupDate; + } + + + public void setSetupDate(String setupDate) { + this.setupDate = setupDate; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails ownershipType(String ownershipType) { + + this.ownershipType = ownershipType; + return this; + } + + /** + * Get ownershipType + * @return ownershipType + **/ + @javax.annotation.Nullable + @Schema(example = "Private Limited Company", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getOwnershipType() { + return ownershipType; + } + + + public void setOwnershipType(String ownershipType) { + this.ownershipType = ownershipType; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails employerConfidenceScore(BigDecimal employerConfidenceScore) { + + this.employerConfidenceScore = employerConfidenceScore; + return this; + } + + /** + * Get employerConfidenceScore + * @return employerConfidenceScore + **/ + @javax.annotation.Nullable + @Schema(example = "0.3", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public BigDecimal getEmployerConfidenceScore() { + return employerConfidenceScore; + } + + + public void setEmployerConfidenceScore(BigDecimal employerConfidenceScore) { + this.employerConfidenceScore = employerConfidenceScore; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails employerNameMatch(Boolean employerNameMatch) { + + this.employerNameMatch = employerNameMatch; + return this; + } + + /** + * Get employerNameMatch + * @return employerNameMatch + **/ + @javax.annotation.Nullable + @Schema(example = "false", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public Boolean getEmployerNameMatch() { + return employerNameMatch; + } + + + public void setEmployerNameMatch(Boolean employerNameMatch) { + this.employerNameMatch = employerNameMatch; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails pfFilingDetails(List pfFilingDetails) { + + this.pfFilingDetails = pfFilingDetails; + return this; + } + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails addPfFilingDetailsItem(AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner pfFilingDetailsItem) { + if (this.pfFilingDetails == null) { + this.pfFilingDetails = new ArrayList<>(); + } + this.pfFilingDetails.add(pfFilingDetailsItem); + return this; + } + + /** + * Get pfFilingDetails + * @return pfFilingDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getPfFilingDetails() { + return pfFilingDetails; + } + + + public void setPfFilingDetails(List pfFilingDetails) { + this.pfFilingDetails = pfFilingDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails = (AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails) o; + return Objects.equals(this.establishmentId, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.establishmentId) && + Objects.equals(this.establishmentName, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.establishmentName) && + Objects.equals(this.setupDate, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.setupDate) && + Objects.equals(this.ownershipType, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.ownershipType) && + Objects.equals(this.employerConfidenceScore, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.employerConfidenceScore) && + Objects.equals(this.employerNameMatch, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.employerNameMatch) && + Objects.equals(this.pfFilingDetails, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.pfFilingDetails); + } + + @Override + public int hashCode() { + return Objects.hash(establishmentId, establishmentName, setupDate, ownershipType, employerConfidenceScore, employerNameMatch, pfFilingDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails {\n"); + sb.append(" establishmentId: ").append(toIndentedString(establishmentId)).append("\n"); + sb.append(" establishmentName: ").append(toIndentedString(establishmentName)).append("\n"); + sb.append(" setupDate: ").append(toIndentedString(setupDate)).append("\n"); + sb.append(" ownershipType: ").append(toIndentedString(ownershipType)).append("\n"); + sb.append(" employerConfidenceScore: ").append(toIndentedString(employerConfidenceScore)).append("\n"); + sb.append(" employerNameMatch: ").append(toIndentedString(employerNameMatch)).append("\n"); + sb.append(" pfFilingDetails: ").append(toIndentedString(pfFilingDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("establishment_id"); + openapiFields.add("establishment_name"); + openapiFields.add("setup_date"); + openapiFields.add("ownership_type"); + openapiFields.add("employer_confidence_score"); + openapiFields.add("employer_name_match"); + openapiFields.add("pf_filing_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("establishment_id") != null && !jsonObj.get("establishment_id").isJsonNull()) && !jsonObj.get("establishment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_id").toString())); + } + if ((jsonObj.get("establishment_name") != null && !jsonObj.get("establishment_name").isJsonNull()) && !jsonObj.get("establishment_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_name").toString())); + } + if ((jsonObj.get("setup_date") != null && !jsonObj.get("setup_date").isJsonNull()) && !jsonObj.get("setup_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `setup_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("setup_date").toString())); + } + if ((jsonObj.get("ownership_type") != null && !jsonObj.get("ownership_type").isJsonNull()) && !jsonObj.get("ownership_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ownership_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownership_type").toString())); + } + if (jsonObj.get("pf_filing_details") != null && !jsonObj.get("pf_filing_details").isJsonNull()) { + JsonArray jsonArraypfFilingDetails = jsonObj.getAsJsonArray("pf_filing_details"); + if (jsonArraypfFilingDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("pf_filing_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pf_filing_details` to be an array in the JSON string but got `%s`", jsonObj.get("pf_filing_details").toString())); + } + + // validate the optional field `pf_filing_details` (array) + for (int i = 0; i < jsonArraypfFilingDetails.size(); i++) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.validateJsonElement(jsonArraypfFilingDetails.get(i)); + }; + } + } + } + + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("establishment_id") != null && !jsonObj.get("establishment_id").isJsonNull()) && !jsonObj.get("establishment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_id").toString())); + } + if ((jsonObj.get("establishment_name") != null && !jsonObj.get("establishment_name").isJsonNull()) && !jsonObj.get("establishment_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_name").toString())); + } + if ((jsonObj.get("setup_date") != null && !jsonObj.get("setup_date").isJsonNull()) && !jsonObj.get("setup_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `setup_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("setup_date").toString())); + } + if ((jsonObj.get("ownership_type") != null && !jsonObj.get("ownership_type").isJsonNull()) && !jsonObj.get("ownership_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ownership_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownership_type").toString())); + } + if (jsonObj.get("pf_filing_details") != null && !jsonObj.get("pf_filing_details").isJsonNull()) { + JsonArray jsonArraypfFilingDetails = jsonObj.getAsJsonArray("pf_filing_details"); + if (jsonArraypfFilingDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("pf_filing_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pf_filing_details` to be an array in the JSON string but got `%s`", jsonObj.get("pf_filing_details").toString())); + } + + // validate the optional field `pf_filing_details` (array) + for (int i = 0; i < jsonArraypfFilingDetails.size(); i++) { + AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.validateJsonElement(jsonArraypfFilingDetails.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails + */ + public static AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.java new file mode 100644 index 0000000..8da2c64 --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.java @@ -0,0 +1,274 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner { + public static final String SERIALIZED_NAME_TOTAL_AMOUNT = "total_amount"; + @SerializedName(SERIALIZED_NAME_TOTAL_AMOUNT) + private BigDecimal totalAmount; + + public static final String SERIALIZED_NAME_EMPLOYEES_COUNT = "employees_count"; + @SerializedName(SERIALIZED_NAME_EMPLOYEES_COUNT) + private BigDecimal employeesCount; + + public static final String SERIALIZED_NAME_WAGE_MONTH = "wage_month"; + @SerializedName(SERIALIZED_NAME_WAGE_MONTH) + private String wageMonth; + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner() { + } + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner totalAmount(BigDecimal totalAmount) { + + this.totalAmount = totalAmount; + return this; + } + + /** + * Get totalAmount + * @return totalAmount + **/ + @javax.annotation.Nullable + @Schema(example = "37524", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public BigDecimal getTotalAmount() { + return totalAmount; + } + + + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner employeesCount(BigDecimal employeesCount) { + + this.employeesCount = employeesCount; + return this; + } + + /** + * Get employeesCount + * @return employeesCount + **/ + @javax.annotation.Nullable + @Schema(example = "17", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public BigDecimal getEmployeesCount() { + return employeesCount; + } + + + public void setEmployeesCount(BigDecimal employeesCount) { + this.employeesCount = employeesCount; + } + + + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner wageMonth(String wageMonth) { + + this.wageMonth = wageMonth; + return this; + } + + /** + * Get wageMonth + * @return wageMonth + **/ + @javax.annotation.Nullable + @Schema(example = "NOV-23", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getWageMonth() { + return wageMonth; + } + + + public void setWageMonth(String wageMonth) { + this.wageMonth = wageMonth; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner advanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner = (AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner) o; + return Objects.equals(this.totalAmount, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.totalAmount) && + Objects.equals(this.employeesCount, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.employeesCount) && + Objects.equals(this.wageMonth, advanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.wageMonth); + } + + @Override + public int hashCode() { + return Objects.hash(totalAmount, employeesCount, wageMonth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner {\n"); + sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); + sb.append(" employeesCount: ").append(toIndentedString(employeesCount)).append("\n"); + sb.append(" wageMonth: ").append(toIndentedString(wageMonth)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("total_amount"); + openapiFields.add("employees_count"); + openapiFields.add("wage_month"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("wage_month") != null && !jsonObj.get("wage_month").isJsonNull()) && !jsonObj.get("wage_month").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `wage_month` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wage_month").toString())); + } + } + + + /** + * 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 AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("wage_month") != null && !jsonObj.get("wage_month").isJsonNull()) && !jsonObj.get("wage_month").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `wage_month` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wage_month").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner + */ + public static AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseRecentEmploymentDetailsEmployerDetailsPfFilingDetailsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInner.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInner.java new file mode 100644 index 0000000..b68767a --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInner.java @@ -0,0 +1,398 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails; +import com.cashfree.model.AdvanceEmploymentResponseUanDetailsInnerBasicDetails; +import com.cashfree.model.AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the information in individual components. + */ +@Schema(description = "It contains the information in individual components.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseUanDetailsInner { + public static final String SERIALIZED_NAME_UAN = "uan"; + @SerializedName(SERIALIZED_NAME_UAN) + private String uan; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_SOURCE_SCORE = "source_score"; + @SerializedName(SERIALIZED_NAME_SOURCE_SCORE) + private BigDecimal sourceScore; + + public static final String SERIALIZED_NAME_BASIC_DETAILS = "basic_details"; + @SerializedName(SERIALIZED_NAME_BASIC_DETAILS) + private AdvanceEmploymentResponseUanDetailsInnerBasicDetails basicDetails; + + public static final String SERIALIZED_NAME_EMPLOYMENT_DETAILS = "employment_details"; + @SerializedName(SERIALIZED_NAME_EMPLOYMENT_DETAILS) + private AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails employmentDetails; + + public static final String SERIALIZED_NAME_ADDITIONAL_DETAILS = "additional_details"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_DETAILS) + private AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails additionalDetails; + + public AdvanceEmploymentResponseUanDetailsInner() { + } + + public AdvanceEmploymentResponseUanDetailsInner uan(String uan) { + + this.uan = uan; + return this; + } + + /** + * It displays the Universal Account Number (UAN) information of the employee. + * @return uan + **/ + @javax.annotation.Nullable + @Schema(example = "101340612345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the Universal Account Number (UAN) information of the employee.") + public String getUan() { + return uan; + } + + + public void setUan(String uan) { + this.uan = uan; + } + + + public AdvanceEmploymentResponseUanDetailsInner source(String source) { + + this.source = source; + return this; + } + + /** + * It displays the + * @return source + **/ + @javax.annotation.Nullable + @Schema(example = "dob and name", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the") + public String getSource() { + return source; + } + + + public void setSource(String source) { + this.source = source; + } + + + public AdvanceEmploymentResponseUanDetailsInner sourceScore(BigDecimal sourceScore) { + + this.sourceScore = sourceScore; + return this; + } + + /** + * It displays the + * @return sourceScore + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the") + public BigDecimal getSourceScore() { + return sourceScore; + } + + + public void setSourceScore(BigDecimal sourceScore) { + this.sourceScore = sourceScore; + } + + + public AdvanceEmploymentResponseUanDetailsInner basicDetails(AdvanceEmploymentResponseUanDetailsInnerBasicDetails basicDetails) { + + this.basicDetails = basicDetails; + return this; + } + + /** + * Get basicDetails + * @return basicDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails getBasicDetails() { + return basicDetails; + } + + + public void setBasicDetails(AdvanceEmploymentResponseUanDetailsInnerBasicDetails basicDetails) { + this.basicDetails = basicDetails; + } + + + public AdvanceEmploymentResponseUanDetailsInner employmentDetails(AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails employmentDetails) { + + this.employmentDetails = employmentDetails; + return this; + } + + /** + * Get employmentDetails + * @return employmentDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails getEmploymentDetails() { + return employmentDetails; + } + + + public void setEmploymentDetails(AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails employmentDetails) { + this.employmentDetails = employmentDetails; + } + + + public AdvanceEmploymentResponseUanDetailsInner additionalDetails(AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails additionalDetails) { + + this.additionalDetails = additionalDetails; + return this; + } + + /** + * Get additionalDetails + * @return additionalDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails getAdditionalDetails() { + return additionalDetails; + } + + + public void setAdditionalDetails(AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails additionalDetails) { + this.additionalDetails = additionalDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseUanDetailsInner advanceEmploymentResponseUanDetailsInner = (AdvanceEmploymentResponseUanDetailsInner) o; + return Objects.equals(this.uan, advanceEmploymentResponseUanDetailsInner.uan) && + Objects.equals(this.source, advanceEmploymentResponseUanDetailsInner.source) && + Objects.equals(this.sourceScore, advanceEmploymentResponseUanDetailsInner.sourceScore) && + Objects.equals(this.basicDetails, advanceEmploymentResponseUanDetailsInner.basicDetails) && + Objects.equals(this.employmentDetails, advanceEmploymentResponseUanDetailsInner.employmentDetails) && + Objects.equals(this.additionalDetails, advanceEmploymentResponseUanDetailsInner.additionalDetails); + } + + @Override + public int hashCode() { + return Objects.hash(uan, source, sourceScore, basicDetails, employmentDetails, additionalDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseUanDetailsInner {\n"); + sb.append(" uan: ").append(toIndentedString(uan)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" sourceScore: ").append(toIndentedString(sourceScore)).append("\n"); + sb.append(" basicDetails: ").append(toIndentedString(basicDetails)).append("\n"); + sb.append(" employmentDetails: ").append(toIndentedString(employmentDetails)).append("\n"); + sb.append(" additionalDetails: ").append(toIndentedString(additionalDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uan"); + openapiFields.add("source"); + openapiFields.add("source_score"); + openapiFields.add("basic_details"); + openapiFields.add("employment_details"); + openapiFields.add("additional_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseUanDetailsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) && !jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + // validate the optional field `basic_details` + if (jsonObj.get("basic_details") != null && !jsonObj.get("basic_details").isJsonNull()) { + AdvanceEmploymentResponseUanDetailsInnerBasicDetails.validateJsonElement(jsonObj.get("basic_details")); + } + // validate the optional field `employment_details` + if (jsonObj.get("employment_details") != null && !jsonObj.get("employment_details").isJsonNull()) { + AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.validateJsonElement(jsonObj.get("employment_details")); + } + // validate the optional field `additional_details` + if (jsonObj.get("additional_details") != null && !jsonObj.get("additional_details").isJsonNull()) { + AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.validateJsonElement(jsonObj.get("additional_details")); + } + } + + + /** + * 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 AdvanceEmploymentResponseUanDetailsInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uan") != null && !jsonObj.get("uan").isJsonNull()) && !jsonObj.get("uan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uan").toString())); + } + if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) && !jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + // validate the optional field `basic_details` + if (jsonObj.get("basic_details") != null && !jsonObj.get("basic_details").isJsonNull()) { + AdvanceEmploymentResponseUanDetailsInnerBasicDetails.validateJsonElement(jsonObj.get("basic_details")); + return true; + } + // validate the optional field `employment_details` + if (jsonObj.get("employment_details") != null && !jsonObj.get("employment_details").isJsonNull()) { + AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.validateJsonElement(jsonObj.get("employment_details")); + return true; + } + // validate the optional field `additional_details` + if (jsonObj.get("additional_details") != null && !jsonObj.get("additional_details").isJsonNull()) { + AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.validateJsonElement(jsonObj.get("additional_details")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseUanDetailsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseUanDetailsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseUanDetailsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseUanDetailsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseUanDetailsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseUanDetailsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseUanDetailsInner + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseUanDetailsInner + */ + public static AdvanceEmploymentResponseUanDetailsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseUanDetailsInner.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseUanDetailsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.java new file mode 100644 index 0000000..876b31b --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.java @@ -0,0 +1,461 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains additional information of the individual. + */ +@Schema(description = "It contains additional information of the individual.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails { + public static final String SERIALIZED_NAME_AADHAAR = "aadhaar"; + @SerializedName(SERIALIZED_NAME_AADHAAR) + private String aadhaar; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_IFSC = "ifsc"; + @SerializedName(SERIALIZED_NAME_IFSC) + private String ifsc; + + public static final String SERIALIZED_NAME_BANK_ACCOUNT = "bank_account"; + @SerializedName(SERIALIZED_NAME_BANK_ACCOUNT) + private String bankAccount; + + public static final String SERIALIZED_NAME_BANK_ADDRESS = "bank_address"; + @SerializedName(SERIALIZED_NAME_BANK_ADDRESS) + private String bankAddress; + + public static final String SERIALIZED_NAME_RELATION = "relation"; + @SerializedName(SERIALIZED_NAME_RELATION) + private String relation; + + public static final String SERIALIZED_NAME_RELATIVE_NAME = "relative_name"; + @SerializedName(SERIALIZED_NAME_RELATIVE_NAME) + private String relativeName; + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails() { + } + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails aadhaar(String aadhaar) { + + this.aadhaar = aadhaar; + return this; + } + + /** + * It displays the aadhaar information of the individual. + * @return aadhaar + **/ + @javax.annotation.Nullable + @Schema(example = "XXXXXXXX7561", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the aadhaar information of the individual.") + public String getAadhaar() { + return aadhaar; + } + + + public void setAadhaar(String aadhaar) { + this.aadhaar = aadhaar; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails email(String email) { + + this.email = email; + return this; + } + + /** + * It displays the email address of the individual. + * @return email + **/ + @javax.annotation.Nullable + @Schema(example = "johndoe@gmail.com", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the email address of the individual.") + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It displays the PAN information of the individual. + * @return pan + **/ + @javax.annotation.Nullable + @Schema(example = "ABCDE5930G", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PAN information of the individual.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails ifsc(String ifsc) { + + this.ifsc = ifsc; + return this; + } + + /** + * It displays the IFSC information of the individual's bank account. + * @return ifsc + **/ + @javax.annotation.Nullable + @Schema(example = "SBIN0012345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the IFSC information of the individual's bank account.") + public String getIfsc() { + return ifsc; + } + + + public void setIfsc(String ifsc) { + this.ifsc = ifsc; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails bankAccount(String bankAccount) { + + this.bankAccount = bankAccount; + return this; + } + + /** + * It displays the bank account number of the individual. + * @return bankAccount + **/ + @javax.annotation.Nullable + @Schema(example = "20329012345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the bank account number of the individual.") + public String getBankAccount() { + return bankAccount; + } + + + public void setBankAccount(String bankAccount) { + this.bankAccount = bankAccount; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails bankAddress(String bankAddress) { + + this.bankAddress = bankAddress; + return this; + } + + /** + * It displays the address of the bank. + * @return bankAddress + **/ + @javax.annotation.Nullable + @Schema(example = "STATE BANK OF INDIA,KATANGA BENGALURU", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address of the bank.") + public String getBankAddress() { + return bankAddress; + } + + + public void setBankAddress(String bankAddress) { + this.bankAddress = bankAddress; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails relation(String relation) { + + this.relation = relation; + return this; + } + + /** + * It displays the realtionship of the individual with the relative. + * @return relation + **/ + @javax.annotation.Nullable + @Schema(example = "F", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the realtionship of the individual with the relative.") + public String getRelation() { + return relation; + } + + + public void setRelation(String relation) { + this.relation = relation; + } + + + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails relativeName(String relativeName) { + + this.relativeName = relativeName; + return this; + } + + /** + * It displays the name of the relative. + * @return relativeName + **/ + @javax.annotation.Nullable + @Schema(example = "Alice Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the relative.") + public String getRelativeName() { + return relativeName; + } + + + public void setRelativeName(String relativeName) { + this.relativeName = relativeName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails advanceEmploymentResponseUanDetailsInnerAdditionalDetails = (AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails) o; + return Objects.equals(this.aadhaar, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.aadhaar) && + Objects.equals(this.email, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.email) && + Objects.equals(this.pan, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.pan) && + Objects.equals(this.ifsc, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.ifsc) && + Objects.equals(this.bankAccount, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.bankAccount) && + Objects.equals(this.bankAddress, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.bankAddress) && + Objects.equals(this.relation, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.relation) && + Objects.equals(this.relativeName, advanceEmploymentResponseUanDetailsInnerAdditionalDetails.relativeName); + } + + @Override + public int hashCode() { + return Objects.hash(aadhaar, email, pan, ifsc, bankAccount, bankAddress, relation, relativeName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails {\n"); + sb.append(" aadhaar: ").append(toIndentedString(aadhaar)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" ifsc: ").append(toIndentedString(ifsc)).append("\n"); + sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n"); + sb.append(" bankAddress: ").append(toIndentedString(bankAddress)).append("\n"); + sb.append(" relation: ").append(toIndentedString(relation)).append("\n"); + sb.append(" relativeName: ").append(toIndentedString(relativeName)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("aadhaar"); + openapiFields.add("email"); + openapiFields.add("pan"); + openapiFields.add("ifsc"); + openapiFields.add("bank_account"); + openapiFields.add("bank_address"); + openapiFields.add("relation"); + openapiFields.add("relative_name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("aadhaar") != null && !jsonObj.get("aadhaar").isJsonNull()) && !jsonObj.get("aadhaar").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("ifsc") != null && !jsonObj.get("ifsc").isJsonNull()) && !jsonObj.get("ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ifsc").toString())); + } + if ((jsonObj.get("bank_account") != null && !jsonObj.get("bank_account").isJsonNull()) && !jsonObj.get("bank_account").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_account").toString())); + } + if ((jsonObj.get("bank_address") != null && !jsonObj.get("bank_address").isJsonNull()) && !jsonObj.get("bank_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_address").toString())); + } + if ((jsonObj.get("relation") != null && !jsonObj.get("relation").isJsonNull()) && !jsonObj.get("relation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation").toString())); + } + if ((jsonObj.get("relative_name") != null && !jsonObj.get("relative_name").isJsonNull()) && !jsonObj.get("relative_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relative_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relative_name").toString())); + } + } + + + /** + * 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 AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("aadhaar") != null && !jsonObj.get("aadhaar").isJsonNull()) && !jsonObj.get("aadhaar").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("ifsc") != null && !jsonObj.get("ifsc").isJsonNull()) && !jsonObj.get("ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ifsc").toString())); + } + if ((jsonObj.get("bank_account") != null && !jsonObj.get("bank_account").isJsonNull()) && !jsonObj.get("bank_account").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_account").toString())); + } + if ((jsonObj.get("bank_address") != null && !jsonObj.get("bank_address").isJsonNull()) && !jsonObj.get("bank_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_address").toString())); + } + if ((jsonObj.get("relation") != null && !jsonObj.get("relation").isJsonNull()) && !jsonObj.get("relation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation").toString())); + } + if ((jsonObj.get("relative_name") != null && !jsonObj.get("relative_name").isJsonNull()) && !jsonObj.get("relative_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relative_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relative_name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails + */ + public static AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseUanDetailsInnerAdditionalDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerBasicDetails.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerBasicDetails.java new file mode 100644 index 0000000..1ce862c --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerBasicDetails.java @@ -0,0 +1,380 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It displays the basic information of the employee. + */ +@Schema(description = "It displays the basic information of the employee.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseUanDetailsInnerBasicDetails { + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_EMPLOYEE_CONFIDENCE_SCORE = "employee_confidence_score"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_CONFIDENCE_SCORE) + private BigDecimal employeeConfidenceScore; + + public static final String SERIALIZED_NAME_EMPLOYEE_NAME = "employee_name"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME) + private String employeeName; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone; + + public static final String SERIALIZED_NAME_AADHAAR_VERIFIED = "aadhaar_verified"; + @SerializedName(SERIALIZED_NAME_AADHAAR_VERIFIED) + private Boolean aadhaarVerified; + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails() { + } + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the employee. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "MALE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the employee.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the employee. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "1996-10-02", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the employee.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails employeeConfidenceScore(BigDecimal employeeConfidenceScore) { + + this.employeeConfidenceScore = employeeConfidenceScore; + return this; + } + + /** + * It displays the confidence score for the employee. + * @return employeeConfidenceScore + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the confidence score for the employee.") + public BigDecimal getEmployeeConfidenceScore() { + return employeeConfidenceScore; + } + + + public void setEmployeeConfidenceScore(BigDecimal employeeConfidenceScore) { + this.employeeConfidenceScore = employeeConfidenceScore; + } + + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails employeeName(String employeeName) { + + this.employeeName = employeeName; + return this; + } + + /** + * It displays the name of the employee. + * @return employeeName + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the employee.") + public String getEmployeeName() { + return employeeName; + } + + + public void setEmployeeName(String employeeName) { + this.employeeName = employeeName; + } + + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * It displays the phone number of the employee. + * @return phone + **/ + @javax.annotation.Nullable + @Schema(example = "9988776655", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the phone number of the employee.") + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails aadhaarVerified(Boolean aadhaarVerified) { + + this.aadhaarVerified = aadhaarVerified; + return this; + } + + /** + * It displays where the aadhaar information of the employee is verified. + * @return aadhaarVerified + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays where the aadhaar information of the employee is verified.") + public Boolean getAadhaarVerified() { + return aadhaarVerified; + } + + + public void setAadhaarVerified(Boolean aadhaarVerified) { + this.aadhaarVerified = aadhaarVerified; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseUanDetailsInnerBasicDetails advanceEmploymentResponseUanDetailsInnerBasicDetails = (AdvanceEmploymentResponseUanDetailsInnerBasicDetails) o; + return Objects.equals(this.gender, advanceEmploymentResponseUanDetailsInnerBasicDetails.gender) && + Objects.equals(this.dob, advanceEmploymentResponseUanDetailsInnerBasicDetails.dob) && + Objects.equals(this.employeeConfidenceScore, advanceEmploymentResponseUanDetailsInnerBasicDetails.employeeConfidenceScore) && + Objects.equals(this.employeeName, advanceEmploymentResponseUanDetailsInnerBasicDetails.employeeName) && + Objects.equals(this.phone, advanceEmploymentResponseUanDetailsInnerBasicDetails.phone) && + Objects.equals(this.aadhaarVerified, advanceEmploymentResponseUanDetailsInnerBasicDetails.aadhaarVerified); + } + + @Override + public int hashCode() { + return Objects.hash(gender, dob, employeeConfidenceScore, employeeName, phone, aadhaarVerified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseUanDetailsInnerBasicDetails {\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" employeeConfidenceScore: ").append(toIndentedString(employeeConfidenceScore)).append("\n"); + sb.append(" employeeName: ").append(toIndentedString(employeeName)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" aadhaarVerified: ").append(toIndentedString(aadhaarVerified)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("gender"); + openapiFields.add("dob"); + openapiFields.add("employee_confidence_score"); + openapiFields.add("employee_name"); + openapiFields.add("phone"); + openapiFields.add("aadhaar_verified"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseUanDetailsInnerBasicDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("employee_name") != null && !jsonObj.get("employee_name").isJsonNull()) && !jsonObj.get("employee_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_name").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + + /** + * 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 AdvanceEmploymentResponseUanDetailsInnerBasicDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("employee_name") != null && !jsonObj.get("employee_name").isJsonNull()) && !jsonObj.get("employee_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_name").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseUanDetailsInnerBasicDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseUanDetailsInnerBasicDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseUanDetailsInnerBasicDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseUanDetailsInnerBasicDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseUanDetailsInnerBasicDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseUanDetailsInnerBasicDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseUanDetailsInnerBasicDetails + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseUanDetailsInnerBasicDetails + */ + public static AdvanceEmploymentResponseUanDetailsInnerBasicDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseUanDetailsInnerBasicDetails.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseUanDetailsInnerBasicDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.java b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.java new file mode 100644 index 0000000..e83cfec --- /dev/null +++ b/src/main/java/com/cashfree/model/AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.java @@ -0,0 +1,421 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the employement details of the individual. + */ +@Schema(description = "It contains the employement details of the individual.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails { + public static final String SERIALIZED_NAME_MEMBER_ID = "member_id"; + @SerializedName(SERIALIZED_NAME_MEMBER_ID) + private String memberId; + + public static final String SERIALIZED_NAME_ESTABLISHMENT_ID = "establishment_id"; + @SerializedName(SERIALIZED_NAME_ESTABLISHMENT_ID) + private String establishmentId; + + public static final String SERIALIZED_NAME_EXIT_DATE = "exit_date"; + @SerializedName(SERIALIZED_NAME_EXIT_DATE) + private String exitDate; + + public static final String SERIALIZED_NAME_JOINING_DATE = "joining_date"; + @SerializedName(SERIALIZED_NAME_JOINING_DATE) + private String joiningDate; + + public static final String SERIALIZED_NAME_LEAVE_REASON = "leave_reason"; + @SerializedName(SERIALIZED_NAME_LEAVE_REASON) + private String leaveReason; + + public static final String SERIALIZED_NAME_ESTABLISHMENT_NAME = "establishment_name"; + @SerializedName(SERIALIZED_NAME_ESTABLISHMENT_NAME) + private String establishmentName; + + public static final String SERIALIZED_NAME_EMPLOYER_CONFIDENCE_SCORE = "employer_confidence_score"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_CONFIDENCE_SCORE) + private BigDecimal employerConfidenceScore; + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails() { + } + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails memberId(String memberId) { + + this.memberId = memberId; + return this; + } + + /** + * It displays the unique ID assigned to an individual. + * @return memberId + **/ + @javax.annotation.Nullable + @Schema(example = "MHBAN12342200000012345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID assigned to an individual.") + public String getMemberId() { + return memberId; + } + + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails establishmentId(String establishmentId) { + + this.establishmentId = establishmentId; + return this; + } + + /** + * It displays the unique ID assigned to a specific establishment or business entity. + * @return establishmentId + **/ + @javax.annotation.Nullable + @Schema(example = "MHBAN1234220000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID assigned to a specific establishment or business entity.") + public String getEstablishmentId() { + return establishmentId; + } + + + public void setEstablishmentId(String establishmentId) { + this.establishmentId = establishmentId; + } + + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails exitDate(String exitDate) { + + this.exitDate = exitDate; + return this; + } + + /** + * It displays the last working day of the employee in the organisation. + * @return exitDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the last working day of the employee in the organisation.") + public String getExitDate() { + return exitDate; + } + + + public void setExitDate(String exitDate) { + this.exitDate = exitDate; + } + + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails joiningDate(String joiningDate) { + + this.joiningDate = joiningDate; + return this; + } + + /** + * It displays the first working day of the employee in the organisation. + * @return joiningDate + **/ + @javax.annotation.Nullable + @Schema(example = "2020-02-21", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the first working day of the employee in the organisation.") + public String getJoiningDate() { + return joiningDate; + } + + + public void setJoiningDate(String joiningDate) { + this.joiningDate = joiningDate; + } + + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails leaveReason(String leaveReason) { + + this.leaveReason = leaveReason; + return this; + } + + /** + * It displays the reason for leaving the previous job. + * @return leaveReason + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the reason for leaving the previous job.") + public String getLeaveReason() { + return leaveReason; + } + + + public void setLeaveReason(String leaveReason) { + this.leaveReason = leaveReason; + } + + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails establishmentName(String establishmentName) { + + this.establishmentName = establishmentName; + return this; + } + + /** + * It displays the name of the organisation. + * @return establishmentName + **/ + @javax.annotation.Nullable + @Schema(example = "Cashfree India Private Ltd", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the organisation.") + public String getEstablishmentName() { + return establishmentName; + } + + + public void setEstablishmentName(String establishmentName) { + this.establishmentName = establishmentName; + } + + + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails employerConfidenceScore(BigDecimal employerConfidenceScore) { + + this.employerConfidenceScore = employerConfidenceScore; + return this; + } + + /** + * It displays the + * @return employerConfidenceScore + **/ + @javax.annotation.Nullable + @Schema(example = "0.1", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the") + public BigDecimal getEmployerConfidenceScore() { + return employerConfidenceScore; + } + + + public void setEmployerConfidenceScore(BigDecimal employerConfidenceScore) { + this.employerConfidenceScore = employerConfidenceScore; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails advanceEmploymentResponseUanDetailsInnerEmploymentDetails = (AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails) o; + return Objects.equals(this.memberId, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.memberId) && + Objects.equals(this.establishmentId, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.establishmentId) && + Objects.equals(this.exitDate, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.exitDate) && + Objects.equals(this.joiningDate, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.joiningDate) && + Objects.equals(this.leaveReason, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.leaveReason) && + Objects.equals(this.establishmentName, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.establishmentName) && + Objects.equals(this.employerConfidenceScore, advanceEmploymentResponseUanDetailsInnerEmploymentDetails.employerConfidenceScore); + } + + @Override + public int hashCode() { + return Objects.hash(memberId, establishmentId, exitDate, joiningDate, leaveReason, establishmentName, employerConfidenceScore); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails {\n"); + sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); + sb.append(" establishmentId: ").append(toIndentedString(establishmentId)).append("\n"); + sb.append(" exitDate: ").append(toIndentedString(exitDate)).append("\n"); + sb.append(" joiningDate: ").append(toIndentedString(joiningDate)).append("\n"); + sb.append(" leaveReason: ").append(toIndentedString(leaveReason)).append("\n"); + sb.append(" establishmentName: ").append(toIndentedString(establishmentName)).append("\n"); + sb.append(" employerConfidenceScore: ").append(toIndentedString(employerConfidenceScore)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("member_id"); + openapiFields.add("establishment_id"); + openapiFields.add("exit_date"); + openapiFields.add("joining_date"); + openapiFields.add("leave_reason"); + openapiFields.add("establishment_name"); + openapiFields.add("employer_confidence_score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("member_id") != null && !jsonObj.get("member_id").isJsonNull()) && !jsonObj.get("member_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `member_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("member_id").toString())); + } + if ((jsonObj.get("establishment_id") != null && !jsonObj.get("establishment_id").isJsonNull()) && !jsonObj.get("establishment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_id").toString())); + } + if ((jsonObj.get("exit_date") != null && !jsonObj.get("exit_date").isJsonNull()) && !jsonObj.get("exit_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exit_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exit_date").toString())); + } + if ((jsonObj.get("joining_date") != null && !jsonObj.get("joining_date").isJsonNull()) && !jsonObj.get("joining_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `joining_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("joining_date").toString())); + } + if ((jsonObj.get("leave_reason") != null && !jsonObj.get("leave_reason").isJsonNull()) && !jsonObj.get("leave_reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `leave_reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("leave_reason").toString())); + } + if ((jsonObj.get("establishment_name") != null && !jsonObj.get("establishment_name").isJsonNull()) && !jsonObj.get("establishment_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_name").toString())); + } + } + + + /** + * 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 AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("member_id") != null && !jsonObj.get("member_id").isJsonNull()) && !jsonObj.get("member_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `member_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("member_id").toString())); + } + if ((jsonObj.get("establishment_id") != null && !jsonObj.get("establishment_id").isJsonNull()) && !jsonObj.get("establishment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_id").toString())); + } + if ((jsonObj.get("exit_date") != null && !jsonObj.get("exit_date").isJsonNull()) && !jsonObj.get("exit_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exit_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exit_date").toString())); + } + if ((jsonObj.get("joining_date") != null && !jsonObj.get("joining_date").isJsonNull()) && !jsonObj.get("joining_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `joining_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("joining_date").toString())); + } + if ((jsonObj.get("leave_reason") != null && !jsonObj.get("leave_reason").isJsonNull()) && !jsonObj.get("leave_reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `leave_reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("leave_reason").toString())); + } + if ((jsonObj.get("establishment_name") != null && !jsonObj.get("establishment_name").isJsonNull()) && !jsonObj.get("establishment_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `establishment_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("establishment_name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails + * @throws IOException if the JSON string is invalid with respect to AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails + */ + public static AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails.class); + } + + /** + * Convert an instance of AdvanceEmploymentResponseUanDetailsInnerEmploymentDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/BadgeDetails.java b/src/main/java/com/cashfree/model/BadgeDetails.java new file mode 100644 index 0000000..6386259 --- /dev/null +++ b/src/main/java/com/cashfree/model/BadgeDetails.java @@ -0,0 +1,298 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains information regarding any badges or emblems affixed to the vehicle. These badges could indicate various things such as the vehicle's model, trim level, special editions, or manufacturer-specific badges. + */ +@Schema(description = "It contains information regarding any badges or emblems affixed to the vehicle. These badges could indicate various things such as the vehicle's model, trim level, special editions, or manufacturer-specific badges.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class BadgeDetails { + public static final String SERIALIZED_NAME_BADGE_ISSUE_DATE = "badge_issue_date"; + @SerializedName(SERIALIZED_NAME_BADGE_ISSUE_DATE) + private String badgeIssueDate; + + public static final String SERIALIZED_NAME_BADGE_NO = "badge_no"; + @SerializedName(SERIALIZED_NAME_BADGE_NO) + private String badgeNo; + + public static final String SERIALIZED_NAME_CLASS_OF_VEHICLE = "class_of_vehicle"; + @SerializedName(SERIALIZED_NAME_CLASS_OF_VEHICLE) + private List classOfVehicle; + + public BadgeDetails() { + } + + public BadgeDetails badgeIssueDate(String badgeIssueDate) { + + this.badgeIssueDate = badgeIssueDate; + return this; + } + + /** + * It displays the date of the badge issued. + * @return badgeIssueDate + **/ + @javax.annotation.Nullable + @Schema(example = "2023-10-23", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of the badge issued.") + public String getBadgeIssueDate() { + return badgeIssueDate; + } + + + public void setBadgeIssueDate(String badgeIssueDate) { + this.badgeIssueDate = badgeIssueDate; + } + + + public BadgeDetails badgeNo(String badgeNo) { + + this.badgeNo = badgeNo; + return this; + } + + /** + * It displays the number of the badge issued. + * @return badgeNo + **/ + @javax.annotation.Nullable + @Schema(example = "2389082", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number of the badge issued.") + public String getBadgeNo() { + return badgeNo; + } + + + public void setBadgeNo(String badgeNo) { + this.badgeNo = badgeNo; + } + + + public BadgeDetails classOfVehicle(List classOfVehicle) { + + this.classOfVehicle = classOfVehicle; + return this; + } + + public BadgeDetails addClassOfVehicleItem(String classOfVehicleItem) { + if (this.classOfVehicle == null) { + this.classOfVehicle = new ArrayList<>(); + } + this.classOfVehicle.add(classOfVehicleItem); + return this; + } + + /** + * It displays the class of the vehicle. + * @return classOfVehicle + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the class of the vehicle.") + public List getClassOfVehicle() { + return classOfVehicle; + } + + + public void setClassOfVehicle(List classOfVehicle) { + this.classOfVehicle = classOfVehicle; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadgeDetails badgeDetails = (BadgeDetails) o; + return Objects.equals(this.badgeIssueDate, badgeDetails.badgeIssueDate) && + Objects.equals(this.badgeNo, badgeDetails.badgeNo) && + Objects.equals(this.classOfVehicle, badgeDetails.classOfVehicle); + } + + @Override + public int hashCode() { + return Objects.hash(badgeIssueDate, badgeNo, classOfVehicle); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadgeDetails {\n"); + sb.append(" badgeIssueDate: ").append(toIndentedString(badgeIssueDate)).append("\n"); + sb.append(" badgeNo: ").append(toIndentedString(badgeNo)).append("\n"); + sb.append(" classOfVehicle: ").append(toIndentedString(classOfVehicle)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("badge_issue_date"); + openapiFields.add("badge_no"); + openapiFields.add("class_of_vehicle"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 BadgeDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("badge_issue_date") != null && !jsonObj.get("badge_issue_date").isJsonNull()) && !jsonObj.get("badge_issue_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `badge_issue_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("badge_issue_date").toString())); + } + if ((jsonObj.get("badge_no") != null && !jsonObj.get("badge_no").isJsonNull()) && !jsonObj.get("badge_no").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `badge_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("badge_no").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("class_of_vehicle") != null && !jsonObj.get("class_of_vehicle").isJsonNull() && !jsonObj.get("class_of_vehicle").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `class_of_vehicle` to be an array in the JSON string but got `%s`", jsonObj.get("class_of_vehicle").toString())); + } + } + + + /** + * 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 BadgeDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("badge_issue_date") != null && !jsonObj.get("badge_issue_date").isJsonNull()) && !jsonObj.get("badge_issue_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `badge_issue_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("badge_issue_date").toString())); + } + if ((jsonObj.get("badge_no") != null && !jsonObj.get("badge_no").isJsonNull()) && !jsonObj.get("badge_no").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `badge_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("badge_no").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("class_of_vehicle") != null && !jsonObj.get("class_of_vehicle").isJsonNull() && !jsonObj.get("class_of_vehicle").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `class_of_vehicle` to be an array in the JSON string but got `%s`", jsonObj.get("class_of_vehicle").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BadgeDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BadgeDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BadgeDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BadgeDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BadgeDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BadgeDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of BadgeDetails + * @throws IOException if the JSON string is invalid with respect to BadgeDetails + */ + public static BadgeDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BadgeDetails.class); + } + + /** + * Convert an instance of BadgeDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/BulkPanRequestSchema.java b/src/main/java/com/cashfree/model/BulkPanRequestSchema.java new file mode 100644 index 0000000..99beaf3 --- /dev/null +++ b/src/main/java/com/cashfree/model/BulkPanRequestSchema.java @@ -0,0 +1,284 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.BulkPanRequestSchemaEntriesInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify a large number of PAN information + */ +@Schema(description = "Find the request parameters to verify a large number of PAN information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class BulkPanRequestSchema { + public static final String SERIALIZED_NAME_BULK_VERIFICATION_ID = "bulk_verification_id"; + @SerializedName(SERIALIZED_NAME_BULK_VERIFICATION_ID) + private String bulkVerificationId = "ABCPV1234D"; + + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + private List entries; + + public BulkPanRequestSchema() { + } + + public BulkPanRequestSchema bulkVerificationId(String bulkVerificationId) { + + this.bulkVerificationId = bulkVerificationId; + return this; + } + + /** + * It is the unique ID you create to identify the API request. Only alphanumeric and underscore ( _ ) are allowed. + * @return bulkVerificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABCPV1234D", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the unique ID you create to identify the API request. Only alphanumeric and underscore ( _ ) are allowed.") + public String getBulkVerificationId() { + return bulkVerificationId; + } + + + public void setBulkVerificationId(String bulkVerificationId) { + this.bulkVerificationId = bulkVerificationId; + } + + + public BulkPanRequestSchema entries(List entries) { + + this.entries = entries; + return this; + } + + public BulkPanRequestSchema addEntriesItem(BulkPanRequestSchemaEntriesInner entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * It is the array of PAN details for verification. PAN and name should be included. The name parameter is optional. + * @return entries + **/ + @javax.annotation.Nullable + @Schema(example = "[{\"name\":\"John Doe\",\"pan\":\"ABCPP3011E\"},{\"name\":\"Jane Doe\",\"pan\":\"ABCPP3022E\"}]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the array of PAN details for verification. PAN and name should be included. The name parameter is optional.") + public List getEntries() { + return entries; + } + + + public void setEntries(List entries) { + this.entries = entries; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkPanRequestSchema bulkPanRequestSchema = (BulkPanRequestSchema) o; + return Objects.equals(this.bulkVerificationId, bulkPanRequestSchema.bulkVerificationId) && + Objects.equals(this.entries, bulkPanRequestSchema.entries); + } + + @Override + public int hashCode() { + return Objects.hash(bulkVerificationId, entries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkPanRequestSchema {\n"); + sb.append(" bulkVerificationId: ").append(toIndentedString(bulkVerificationId)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bulk_verification_id"); + openapiFields.add("entries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 BulkPanRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bulk_verification_id") != null && !jsonObj.get("bulk_verification_id").isJsonNull()) && !jsonObj.get("bulk_verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bulk_verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bulk_verification_id").toString())); + } + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + if (!jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `entries` to be an array in the JSON string but got `%s`", jsonObj.get("entries").toString())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + BulkPanRequestSchemaEntriesInner.validateJsonElement(jsonArrayentries.get(i)); + }; + } + } + } + + + /** + * 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 BulkPanRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bulk_verification_id") != null && !jsonObj.get("bulk_verification_id").isJsonNull()) && !jsonObj.get("bulk_verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bulk_verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bulk_verification_id").toString())); + } + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + if (!jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `entries` to be an array in the JSON string but got `%s`", jsonObj.get("entries").toString())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + BulkPanRequestSchemaEntriesInner.validateJsonElement(jsonArrayentries.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BulkPanRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkPanRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkPanRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BulkPanRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BulkPanRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkPanRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkPanRequestSchema + * @throws IOException if the JSON string is invalid with respect to BulkPanRequestSchema + */ + public static BulkPanRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkPanRequestSchema.class); + } + + /** + * Convert an instance of BulkPanRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/BulkPanRequestSchemaEntriesInner.java b/src/main/java/com/cashfree/model/BulkPanRequestSchemaEntriesInner.java new file mode 100644 index 0000000..bae1035 --- /dev/null +++ b/src/main/java/com/cashfree/model/BulkPanRequestSchemaEntriesInner.java @@ -0,0 +1,266 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * BulkPanRequestSchemaEntriesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class BulkPanRequestSchemaEntriesInner { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "John Doe"; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan = "ABCPV1234D"; + + public BulkPanRequestSchemaEntriesInner() { + } + + public BulkPanRequestSchemaEntriesInner name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the individual as registered in the PAN information. + * @return name + **/ + @javax.annotation.Nonnull + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the name of the individual as registered in the PAN information.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public BulkPanRequestSchemaEntriesInner pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It is the PAN information of the individual. + * @return pan + **/ + @javax.annotation.Nonnull + @Schema(example = "ABCPV1234D", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the PAN information of the individual.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkPanRequestSchemaEntriesInner bulkPanRequestSchemaEntriesInner = (BulkPanRequestSchemaEntriesInner) o; + return Objects.equals(this.name, bulkPanRequestSchemaEntriesInner.name) && + Objects.equals(this.pan, bulkPanRequestSchemaEntriesInner.pan); + } + + @Override + public int hashCode() { + return Objects.hash(name, pan); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkPanRequestSchemaEntriesInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("pan"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("pan"); + } + + /** + * 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 BulkPanRequestSchemaEntriesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkPanRequestSchemaEntriesInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + } + + + /** + * 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 BulkPanRequestSchemaEntriesInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkPanRequestSchemaEntriesInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BulkPanRequestSchemaEntriesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkPanRequestSchemaEntriesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkPanRequestSchemaEntriesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BulkPanRequestSchemaEntriesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BulkPanRequestSchemaEntriesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkPanRequestSchemaEntriesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkPanRequestSchemaEntriesInner + * @throws IOException if the JSON string is invalid with respect to BulkPanRequestSchemaEntriesInner + */ + public static BulkPanRequestSchemaEntriesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkPanRequestSchemaEntriesInner.class); + } + + /** + * Convert an instance of BulkPanRequestSchemaEntriesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CinRequestSchema.java b/src/main/java/com/cashfree/model/CinRequestSchema.java new file mode 100644 index 0000000..da0550d --- /dev/null +++ b/src/main/java/com/cashfree/model/CinRequestSchema.java @@ -0,0 +1,267 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to retrieve CIN information + */ +@Schema(description = "Find the request parameters to retrieve CIN information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class CinRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "ABC00123"; + + public static final String SERIALIZED_NAME_CIN = "cin"; + @SerializedName(SERIALIZED_NAME_CIN) + private String cin = "U72900KA2015PTC082988"; + + public CinRequestSchema() { + } + + public CinRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the API request. The maximum character limit is 50. Alphanumeric, period (.), hyphen (-). and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the API request. The maximum character limit is 50. Alphanumeric, period (.), hyphen (-). and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public CinRequestSchema cin(String cin) { + + this.cin = cin; + return this; + } + + /** + * It is the unique alphanumeric identifier assigned to companies registered under the Ministry of Corporate Affairs, India. + * @return cin + **/ + @javax.annotation.Nonnull + @Schema(example = "U72900KA2015PTC082988", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique alphanumeric identifier assigned to companies registered under the Ministry of Corporate Affairs, India.") + public String getCin() { + return cin; + } + + + public void setCin(String cin) { + this.cin = cin; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CinRequestSchema cinRequestSchema = (CinRequestSchema) o; + return Objects.equals(this.verificationId, cinRequestSchema.verificationId) && + Objects.equals(this.cin, cinRequestSchema.cin); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, cin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CinRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" cin: ").append(toIndentedString(cin)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("cin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("cin"); + } + + /** + * 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 CinRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CinRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("cin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cin").toString())); + } + } + + + /** + * 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 CinRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CinRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("cin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cin").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CinRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CinRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CinRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CinRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CinRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CinRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of CinRequestSchema + * @throws IOException if the JSON string is invalid with respect to CinRequestSchema + */ + public static CinRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CinRequestSchema.class); + } + + /** + * Convert an instance of CinRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CinResponseSchema.java b/src/main/java/com/cashfree/model/CinResponseSchema.java new file mode 100644 index 0000000..654bf77 --- /dev/null +++ b/src/main/java/com/cashfree/model/CinResponseSchema.java @@ -0,0 +1,588 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.CinResponseSchemaDirectorDetailsInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for retrieving CIN information + */ +@Schema(description = "Success response for retrieving CIN information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class CinResponseSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CIN = "cin"; + @SerializedName(SERIALIZED_NAME_CIN) + private String cin; + + public static final String SERIALIZED_NAME_COMPANY_NAME = "company_name"; + @SerializedName(SERIALIZED_NAME_COMPANY_NAME) + private String companyName; + + public static final String SERIALIZED_NAME_REGISTRATION_NUMBER = "registration_number"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_NUMBER) + private BigDecimal registrationNumber; + + public static final String SERIALIZED_NAME_INCORPORATION_DATE = "incorporation_date"; + @SerializedName(SERIALIZED_NAME_INCORPORATION_DATE) + private String incorporationDate; + + public static final String SERIALIZED_NAME_CIN_STATUS = "cin_status"; + @SerializedName(SERIALIZED_NAME_CIN_STATUS) + private String cinStatus; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_INCORPORATION_COUNTRY = "incorporation_country"; + @SerializedName(SERIALIZED_NAME_INCORPORATION_COUNTRY) + private String incorporationCountry; + + public static final String SERIALIZED_NAME_DIRECTOR_DETAILS = "director_details"; + @SerializedName(SERIALIZED_NAME_DIRECTOR_DETAILS) + private List directorDetails; + + public CinResponseSchema() { + } + + public CinResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public CinResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public CinResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the CIN information + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the CIN information") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public CinResponseSchema cin(String cin) { + + this.cin = cin; + return this; + } + + /** + * It displays the entered CIN information. + * @return cin + **/ + @javax.annotation.Nullable + @Schema(example = "U72900KA2015PTC082988", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the entered CIN information.") + public String getCin() { + return cin; + } + + + public void setCin(String cin) { + this.cin = cin; + } + + + public CinResponseSchema companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * It displays the name of the company registered under the Ministry of Corporate Affaris. + * @return companyName + **/ + @javax.annotation.Nullable + @Schema(example = "COMPANY NAME", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the company registered under the Ministry of Corporate Affaris.") + public String getCompanyName() { + return companyName; + } + + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public CinResponseSchema registrationNumber(BigDecimal registrationNumber) { + + this.registrationNumber = registrationNumber; + return this; + } + + /** + * It displays the registration number of the company. + * @return registrationNumber + **/ + @javax.annotation.Nullable + @Schema(example = "82987", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the registration number of the company.") + public BigDecimal getRegistrationNumber() { + return registrationNumber; + } + + + public void setRegistrationNumber(BigDecimal registrationNumber) { + this.registrationNumber = registrationNumber; + } + + + public CinResponseSchema incorporationDate(String incorporationDate) { + + this.incorporationDate = incorporationDate; + return this; + } + + /** + * It displays the date of incorporation of the company. + * @return incorporationDate + **/ + @javax.annotation.Nullable + @Schema(example = "23-09-2015", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of incorporation of the company.") + public String getIncorporationDate() { + return incorporationDate; + } + + + public void setIncorporationDate(String incorporationDate) { + this.incorporationDate = incorporationDate; + } + + + public CinResponseSchema cinStatus(String cinStatus) { + + this.cinStatus = cinStatus; + return this; + } + + /** + * It displays the granular level status of the CIN information. + * @return cinStatus + **/ + @javax.annotation.Nullable + @Schema(example = "ACTIVE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the granular level status of the CIN information.") + public String getCinStatus() { + return cinStatus; + } + + + public void setCinStatus(String cinStatus) { + this.cinStatus = cinStatus; + } + + + public CinResponseSchema email(String email) { + + this.email = email; + return this; + } + + /** + * It displays the email ID of the company registered under the Ministry of Company Affairs. + * @return email + **/ + @javax.annotation.Nullable + @Schema(example = "abc@xyz.com", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the email ID of the company registered under the Ministry of Company Affairs.") + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public CinResponseSchema incorporationCountry(String incorporationCountry) { + + this.incorporationCountry = incorporationCountry; + return this; + } + + /** + * It displays the name of the country where the company is located. + * @return incorporationCountry + **/ + @javax.annotation.Nullable + @Schema(example = "INDIA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the country where the company is located.") + public String getIncorporationCountry() { + return incorporationCountry; + } + + + public void setIncorporationCountry(String incorporationCountry) { + this.incorporationCountry = incorporationCountry; + } + + + public CinResponseSchema directorDetails(List directorDetails) { + + this.directorDetails = directorDetails; + return this; + } + + public CinResponseSchema addDirectorDetailsItem(CinResponseSchemaDirectorDetailsInner directorDetailsItem) { + if (this.directorDetails == null) { + this.directorDetails = new ArrayList<>(); + } + this.directorDetails.add(directorDetailsItem); + return this; + } + + /** + * Get directorDetails + * @return directorDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getDirectorDetails() { + return directorDetails; + } + + + public void setDirectorDetails(List directorDetails) { + this.directorDetails = directorDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CinResponseSchema cinResponseSchema = (CinResponseSchema) o; + return Objects.equals(this.verificationId, cinResponseSchema.verificationId) && + Objects.equals(this.referenceId, cinResponseSchema.referenceId) && + Objects.equals(this.status, cinResponseSchema.status) && + Objects.equals(this.cin, cinResponseSchema.cin) && + Objects.equals(this.companyName, cinResponseSchema.companyName) && + Objects.equals(this.registrationNumber, cinResponseSchema.registrationNumber) && + Objects.equals(this.incorporationDate, cinResponseSchema.incorporationDate) && + Objects.equals(this.cinStatus, cinResponseSchema.cinStatus) && + Objects.equals(this.email, cinResponseSchema.email) && + Objects.equals(this.incorporationCountry, cinResponseSchema.incorporationCountry) && + Objects.equals(this.directorDetails, cinResponseSchema.directorDetails); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, referenceId, status, cin, companyName, registrationNumber, incorporationDate, cinStatus, email, incorporationCountry, directorDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CinResponseSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" cin: ").append(toIndentedString(cin)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" registrationNumber: ").append(toIndentedString(registrationNumber)).append("\n"); + sb.append(" incorporationDate: ").append(toIndentedString(incorporationDate)).append("\n"); + sb.append(" cinStatus: ").append(toIndentedString(cinStatus)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" incorporationCountry: ").append(toIndentedString(incorporationCountry)).append("\n"); + sb.append(" directorDetails: ").append(toIndentedString(directorDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("status"); + openapiFields.add("cin"); + openapiFields.add("company_name"); + openapiFields.add("registration_number"); + openapiFields.add("incorporation_date"); + openapiFields.add("cin_status"); + openapiFields.add("email"); + openapiFields.add("incorporation_country"); + openapiFields.add("director_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 CinResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("cin") != null && !jsonObj.get("cin").isJsonNull()) && !jsonObj.get("cin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cin").toString())); + } + if ((jsonObj.get("company_name") != null && !jsonObj.get("company_name").isJsonNull()) && !jsonObj.get("company_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `company_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company_name").toString())); + } + if ((jsonObj.get("incorporation_date") != null && !jsonObj.get("incorporation_date").isJsonNull()) && !jsonObj.get("incorporation_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `incorporation_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("incorporation_date").toString())); + } + if ((jsonObj.get("cin_status") != null && !jsonObj.get("cin_status").isJsonNull()) && !jsonObj.get("cin_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cin_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cin_status").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("incorporation_country") != null && !jsonObj.get("incorporation_country").isJsonNull()) && !jsonObj.get("incorporation_country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `incorporation_country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("incorporation_country").toString())); + } + if (jsonObj.get("director_details") != null && !jsonObj.get("director_details").isJsonNull()) { + JsonArray jsonArraydirectorDetails = jsonObj.getAsJsonArray("director_details"); + if (jsonArraydirectorDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("director_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `director_details` to be an array in the JSON string but got `%s`", jsonObj.get("director_details").toString())); + } + + // validate the optional field `director_details` (array) + for (int i = 0; i < jsonArraydirectorDetails.size(); i++) { + CinResponseSchemaDirectorDetailsInner.validateJsonElement(jsonArraydirectorDetails.get(i)); + }; + } + } + } + + + /** + * 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 CinResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("cin") != null && !jsonObj.get("cin").isJsonNull()) && !jsonObj.get("cin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cin").toString())); + } + if ((jsonObj.get("company_name") != null && !jsonObj.get("company_name").isJsonNull()) && !jsonObj.get("company_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `company_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company_name").toString())); + } + if ((jsonObj.get("incorporation_date") != null && !jsonObj.get("incorporation_date").isJsonNull()) && !jsonObj.get("incorporation_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `incorporation_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("incorporation_date").toString())); + } + if ((jsonObj.get("cin_status") != null && !jsonObj.get("cin_status").isJsonNull()) && !jsonObj.get("cin_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cin_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cin_status").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("incorporation_country") != null && !jsonObj.get("incorporation_country").isJsonNull()) && !jsonObj.get("incorporation_country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `incorporation_country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("incorporation_country").toString())); + } + if (jsonObj.get("director_details") != null && !jsonObj.get("director_details").isJsonNull()) { + JsonArray jsonArraydirectorDetails = jsonObj.getAsJsonArray("director_details"); + if (jsonArraydirectorDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("director_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `director_details` to be an array in the JSON string but got `%s`", jsonObj.get("director_details").toString())); + } + + // validate the optional field `director_details` (array) + for (int i = 0; i < jsonArraydirectorDetails.size(); i++) { + CinResponseSchemaDirectorDetailsInner.validateJsonElement(jsonArraydirectorDetails.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CinResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CinResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CinResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CinResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CinResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CinResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of CinResponseSchema + * @throws IOException if the JSON string is invalid with respect to CinResponseSchema + */ + public static CinResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CinResponseSchema.class); + } + + /** + * Convert an instance of CinResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CinResponseSchemaDirectorDetailsInner.java b/src/main/java/com/cashfree/model/CinResponseSchemaDirectorDetailsInner.java new file mode 100644 index 0000000..8dc1002 --- /dev/null +++ b/src/main/java/com/cashfree/model/CinResponseSchemaDirectorDetailsInner.java @@ -0,0 +1,356 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It displays the details of the director of the company. + */ +@Schema(description = "It displays the details of the director of the company.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class CinResponseSchemaDirectorDetailsInner { + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_DESIGNATION = "designation"; + @SerializedName(SERIALIZED_NAME_DESIGNATION) + private String designation; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_DIN = "din"; + @SerializedName(SERIALIZED_NAME_DIN) + private String din; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public CinResponseSchemaDirectorDetailsInner() { + } + + public CinResponseSchemaDirectorDetailsInner dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the director. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "1997-07-26", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the director.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public CinResponseSchemaDirectorDetailsInner designation(String designation) { + + this.designation = designation; + return this; + } + + /** + * It displays the designation of the director. + * @return designation + **/ + @javax.annotation.Nullable + @Schema(example = "DIRECTOR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the designation of the director.") + public String getDesignation() { + return designation; + } + + + public void setDesignation(String designation) { + this.designation = designation; + } + + + public CinResponseSchemaDirectorDetailsInner address(String address) { + + this.address = address; + return this; + } + + /** + * It displays the address information of the director. + * @return address + **/ + @javax.annotation.Nullable + @Schema(example = "DIRECTOR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address information of the director.") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public CinResponseSchemaDirectorDetailsInner din(String din) { + + this.din = din; + return this; + } + + /** + * It displays the unique identification number assigned to individuals who are appointed as directors of companies in India. + * @return din + **/ + @javax.annotation.Nullable + @Schema(example = "DIRECTOR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique identification number assigned to individuals who are appointed as directors of companies in India.") + public String getDin() { + return din; + } + + + public void setDin(String din) { + this.din = din; + } + + + public CinResponseSchemaDirectorDetailsInner name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the director. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "DIRECTOR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the director.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CinResponseSchemaDirectorDetailsInner cinResponseSchemaDirectorDetailsInner = (CinResponseSchemaDirectorDetailsInner) o; + return Objects.equals(this.dob, cinResponseSchemaDirectorDetailsInner.dob) && + Objects.equals(this.designation, cinResponseSchemaDirectorDetailsInner.designation) && + Objects.equals(this.address, cinResponseSchemaDirectorDetailsInner.address) && + Objects.equals(this.din, cinResponseSchemaDirectorDetailsInner.din) && + Objects.equals(this.name, cinResponseSchemaDirectorDetailsInner.name); + } + + @Override + public int hashCode() { + return Objects.hash(dob, designation, address, din, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CinResponseSchemaDirectorDetailsInner {\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" designation: ").append(toIndentedString(designation)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" din: ").append(toIndentedString(din)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dob"); + openapiFields.add("designation"); + openapiFields.add("address"); + openapiFields.add("din"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 CinResponseSchemaDirectorDetailsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("designation") != null && !jsonObj.get("designation").isJsonNull()) && !jsonObj.get("designation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `designation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("designation").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("din") != null && !jsonObj.get("din").isJsonNull()) && !jsonObj.get("din").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `din` to be a primitive type in the JSON string but got `%s`", jsonObj.get("din").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + + /** + * 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 CinResponseSchemaDirectorDetailsInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("designation") != null && !jsonObj.get("designation").isJsonNull()) && !jsonObj.get("designation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `designation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("designation").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("din") != null && !jsonObj.get("din").isJsonNull()) && !jsonObj.get("din").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `din` to be a primitive type in the JSON string but got `%s`", jsonObj.get("din").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CinResponseSchemaDirectorDetailsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CinResponseSchemaDirectorDetailsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CinResponseSchemaDirectorDetailsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CinResponseSchemaDirectorDetailsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CinResponseSchemaDirectorDetailsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CinResponseSchemaDirectorDetailsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CinResponseSchemaDirectorDetailsInner + * @throws IOException if the JSON string is invalid with respect to CinResponseSchemaDirectorDetailsInner + */ + public static CinResponseSchemaDirectorDetailsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CinResponseSchemaDirectorDetailsInner.class); + } + + /** + * Convert an instance of CinResponseSchemaDirectorDetailsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateRequestRequestSchema.java b/src/main/java/com/cashfree/model/CreateRequestRequestSchema.java new file mode 100644 index 0000000..62e057c --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateRequestRequestSchema.java @@ -0,0 +1,251 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to create a reverse penny order request + */ +@Schema(description = "Find the request parameters to create a reverse penny order request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class CreateRequestRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "11"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "John Doe"; + + public CreateRequestRequestSchema() { + } + + public CreateRequestRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the API request. The maximum character limit is 50. Only alphanumeric, hyphen (-), period (.), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "11", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the unique ID you create to identify the API request. The maximum character limit is 50. Only alphanumeric, hyphen (-), period (.), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public CreateRequestRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the UPI VPA account holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the UPI VPA account holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRequestRequestSchema createRequestRequestSchema = (CreateRequestRequestSchema) o; + return Objects.equals(this.verificationId, createRequestRequestSchema.verificationId) && + Objects.equals(this.name, createRequestRequestSchema.name); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateRequestRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 CreateRequestRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + + /** + * 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 CreateRequestRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateRequestRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateRequestRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateRequestRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateRequestRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateRequestRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateRequestRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateRequestRequestSchema + * @throws IOException if the JSON string is invalid with respect to CreateRequestRequestSchema + */ + public static CreateRequestRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateRequestRequestSchema.class); + } + + /** + * Convert an instance of CreateRequestRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateRequestResponseSchema.java b/src/main/java/com/cashfree/model/CreateRequestResponseSchema.java new file mode 100644 index 0000000..1ec27d2 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateRequestResponseSchema.java @@ -0,0 +1,490 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for creating a reverse penny order request= + */ +@Schema(description = "Success response for creating a reverse penny order request=") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class CreateRequestResponseSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REF_ID = "ref_id"; + @SerializedName(SERIALIZED_NAME_REF_ID) + private Long refId; + + public static final String SERIALIZED_NAME_VALID_UPTO = "valid_upto"; + @SerializedName(SERIALIZED_NAME_VALID_UPTO) + private String validUpto; + + public static final String SERIALIZED_NAME_UPI_LINK = "upi_link"; + @SerializedName(SERIALIZED_NAME_UPI_LINK) + private String upiLink; + + public static final String SERIALIZED_NAME_PAYTM = "paytm"; + @SerializedName(SERIALIZED_NAME_PAYTM) + private String paytm; + + public static final String SERIALIZED_NAME_BHIM = "bhim"; + @SerializedName(SERIALIZED_NAME_BHIM) + private String bhim; + + public static final String SERIALIZED_NAME_GPAY = "gpay"; + @SerializedName(SERIALIZED_NAME_GPAY) + private String gpay; + + public static final String SERIALIZED_NAME_PHONEPE = "phonepe"; + @SerializedName(SERIALIZED_NAME_PHONEPE) + private String phonepe; + + public static final String SERIALIZED_NAME_QR_CODE = "qr_code"; + @SerializedName(SERIALIZED_NAME_QR_CODE) + private String qrCode; + + public CreateRequestResponseSchema() { + } + + public CreateRequestResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify this API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "11", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify this API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public CreateRequestResponseSchema refId(Long refId) { + + this.refId = refId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return refId + **/ + @javax.annotation.Nullable + @Schema(example = "100173", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Long getRefId() { + return refId; + } + + + public void setRefId(Long refId) { + this.refId = refId; + } + + + public CreateRequestResponseSchema validUpto(String validUpto) { + + this.validUpto = validUpto; + return this; + } + + /** + * It displays the time validity of the order request, + * @return validUpto + **/ + @javax.annotation.Nullable + @Schema(example = "2023-11-08 09:32:52", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the time validity of the order request,") + public String getValidUpto() { + return validUpto; + } + + + public void setValidUpto(String validUpto) { + this.validUpto = validUpto; + } + + + public CreateRequestResponseSchema upiLink(String upiLink) { + + this.upiLink = upiLink; + return this; + } + + /** + * It displays the generated UPI link for the reverse penny order request. + * @return upiLink + **/ + @javax.annotation.Nullable + @Schema(example = "upi://pay?pa=yespay.cpisprod01@yesbankltd&pn=Cashfree&tn=BAV&am=1.00&cu=INR&tr=100173&tid=100173", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the generated UPI link for the reverse penny order request.") + public String getUpiLink() { + return upiLink; + } + + + public void setUpiLink(String upiLink) { + this.upiLink = upiLink; + } + + + public CreateRequestResponseSchema paytm(String paytm) { + + this.paytm = paytm; + return this; + } + + /** + * It displays the generated Paytm link for the reverse penny order request. + * @return paytm + **/ + @javax.annotation.Nullable + @Schema(example = "paytmmp://pay?pa=yespay.cpisprod01@yesbankltd&pn=Cashfree&tn=BAV&am=1.00&cu=INR&tr=100173&tid=100173", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the generated Paytm link for the reverse penny order request.") + public String getPaytm() { + return paytm; + } + + + public void setPaytm(String paytm) { + this.paytm = paytm; + } + + + public CreateRequestResponseSchema bhim(String bhim) { + + this.bhim = bhim; + return this; + } + + /** + * It displays the generated BHIM link for the reverse penny order request. + * @return bhim + **/ + @javax.annotation.Nullable + @Schema(example = "bhim://upi://pay?pa=yespay.cpisprod01@yesbankltd&pn=Cashfree&tn=BAV&am=1.00&cu=INR&tr=100173&tid=100173", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the generated BHIM link for the reverse penny order request.") + public String getBhim() { + return bhim; + } + + + public void setBhim(String bhim) { + this.bhim = bhim; + } + + + public CreateRequestResponseSchema gpay(String gpay) { + + this.gpay = gpay; + return this; + } + + /** + * It displays the generated Gpay link for the reverse penny order request. + * @return gpay + **/ + @javax.annotation.Nullable + @Schema(example = "tez://upi/pay?pa=yespay.cpisprod01@yesbankltd&pn=Cashfree&tn=BAV&am=1.00&cu=INR&tr=100173&tid=100173", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the generated Gpay link for the reverse penny order request.") + public String getGpay() { + return gpay; + } + + + public void setGpay(String gpay) { + this.gpay = gpay; + } + + + public CreateRequestResponseSchema phonepe(String phonepe) { + + this.phonepe = phonepe; + return this; + } + + /** + * It displays the generated Phonepe link for the reverse penny order request. + * @return phonepe + **/ + @javax.annotation.Nullable + @Schema(example = "phonepe://pay?pa=yespay.cpisprod01@yesbankltd&pn=Cashfree&tn=BAV&am=1.00&cu=INR&tr=100173&tid=100173", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the generated Phonepe link for the reverse penny order request.") + public String getPhonepe() { + return phonepe; + } + + + public void setPhonepe(String phonepe) { + this.phonepe = phonepe; + } + + + public CreateRequestResponseSchema qrCode(String qrCode) { + + this.qrCode = qrCode; + return this; + } + + /** + * It displays the generated QR code for the reverse penny order request. + * @return qrCode + **/ + @javax.annotation.Nullable + @Schema(example = "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAABlBMVEX///8AAABVwtN+AAACuklEQVR42uyYwa3jMAxEx/CBR5WgTqzGgtiBG5M7UQk66mB4FkP/3WR/A5aB8PZ/3sGUqOGQ+MY3bhhGklsd6sAdiAASJgz6b70RUADLQQgiuaMBqQ0VGHsCSMvhwFBHrvqDDRjqzLUzYCPrwLWM1FG3qU+g6sMfXg9G5hsCgG3MmOtMFoAZiduviroaOJ/eFF71EdeyR8tt0uX8epuXAh4DDzzDSnKknXX9f1wMWEFSCYRXncsjjjpstkTW911cDkCqNbk+PACMhZ5DOMJ6K8Cy5ZDxDIv/bLTsijJ2BbBNyiOsBbqLZAcSX3XuB1CxSBJ+pHiH0bY2cPnQh8sBxJY8hwOIe1T3NfIIR+CNAKmFNwhZhkck9TaZw8c5XA/o6bUpSHnnMlMFw8MEPNANIOV1uzhz5YIdlpUF0BVQSOiYn3p6UL9QA6nP8OEfrgZ01N55l7DEJarj8nDpHW8EWDGe0wIXzBzZ5Hm2t3voAUC0TDkx9Yu5AC21gVKHv1rdBUAi1UnA+6hVMOwHkKfl4W7Mq7qoxxk/GsodALfiQFJeRR3D/aS63r+4HjC2ZOphS2AZqYvhxkPTRO0JgGcx/9jFlixDDWRHP0Bxu+ifzSVSyjxhAjDXjgCkJh+2BHJxu3iOtPVOgDvzzQVkLQ95MbgQz+9h8nrAXBAAPKGa3tFghx2B7+3B9YB78wMTZHJW3x7YaXLmroDsWQxyYjrqJOH99LQ3AHx6POcFf5nlZy1yfBjOy4FzB1JT9Q+nC8ggO/FO83rg3CaRGnLd9CLJiX244h6Ac5nMOlRNvLsPwaYs/o0PPQC+4ZzwlCkre6QvONzW3AzIYeNpedWaW2pTeNXugHPHxbVQ/mFrCK//F/tXA14wWQ2CexyLTxM+BHcE/F0mL2HHI+5AsmzS2h33Ab7xja7iTwAAAP//HxNnsaD8lqMAAAAASUVORK5CYII=", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the generated QR code for the reverse penny order request.") + public String getQrCode() { + return qrCode; + } + + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRequestResponseSchema createRequestResponseSchema = (CreateRequestResponseSchema) o; + return Objects.equals(this.verificationId, createRequestResponseSchema.verificationId) && + Objects.equals(this.refId, createRequestResponseSchema.refId) && + Objects.equals(this.validUpto, createRequestResponseSchema.validUpto) && + Objects.equals(this.upiLink, createRequestResponseSchema.upiLink) && + Objects.equals(this.paytm, createRequestResponseSchema.paytm) && + Objects.equals(this.bhim, createRequestResponseSchema.bhim) && + Objects.equals(this.gpay, createRequestResponseSchema.gpay) && + Objects.equals(this.phonepe, createRequestResponseSchema.phonepe) && + Objects.equals(this.qrCode, createRequestResponseSchema.qrCode); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, refId, validUpto, upiLink, paytm, bhim, gpay, phonepe, qrCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateRequestResponseSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" refId: ").append(toIndentedString(refId)).append("\n"); + sb.append(" validUpto: ").append(toIndentedString(validUpto)).append("\n"); + sb.append(" upiLink: ").append(toIndentedString(upiLink)).append("\n"); + sb.append(" paytm: ").append(toIndentedString(paytm)).append("\n"); + sb.append(" bhim: ").append(toIndentedString(bhim)).append("\n"); + sb.append(" gpay: ").append(toIndentedString(gpay)).append("\n"); + sb.append(" phonepe: ").append(toIndentedString(phonepe)).append("\n"); + sb.append(" qrCode: ").append(toIndentedString(qrCode)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("ref_id"); + openapiFields.add("valid_upto"); + openapiFields.add("upi_link"); + openapiFields.add("paytm"); + openapiFields.add("bhim"); + openapiFields.add("gpay"); + openapiFields.add("phonepe"); + openapiFields.add("qr_code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 CreateRequestResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("valid_upto") != null && !jsonObj.get("valid_upto").isJsonNull()) && !jsonObj.get("valid_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `valid_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("valid_upto").toString())); + } + if ((jsonObj.get("upi_link") != null && !jsonObj.get("upi_link").isJsonNull()) && !jsonObj.get("upi_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `upi_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upi_link").toString())); + } + if ((jsonObj.get("paytm") != null && !jsonObj.get("paytm").isJsonNull()) && !jsonObj.get("paytm").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paytm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paytm").toString())); + } + if ((jsonObj.get("bhim") != null && !jsonObj.get("bhim").isJsonNull()) && !jsonObj.get("bhim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bhim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bhim").toString())); + } + if ((jsonObj.get("gpay") != null && !jsonObj.get("gpay").isJsonNull()) && !jsonObj.get("gpay").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gpay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gpay").toString())); + } + if ((jsonObj.get("phonepe") != null && !jsonObj.get("phonepe").isJsonNull()) && !jsonObj.get("phonepe").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phonepe` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phonepe").toString())); + } + if ((jsonObj.get("qr_code") != null && !jsonObj.get("qr_code").isJsonNull()) && !jsonObj.get("qr_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qr_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qr_code").toString())); + } + } + + + /** + * 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 CreateRequestResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("valid_upto") != null && !jsonObj.get("valid_upto").isJsonNull()) && !jsonObj.get("valid_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `valid_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("valid_upto").toString())); + } + if ((jsonObj.get("upi_link") != null && !jsonObj.get("upi_link").isJsonNull()) && !jsonObj.get("upi_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `upi_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upi_link").toString())); + } + if ((jsonObj.get("paytm") != null && !jsonObj.get("paytm").isJsonNull()) && !jsonObj.get("paytm").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paytm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paytm").toString())); + } + if ((jsonObj.get("bhim") != null && !jsonObj.get("bhim").isJsonNull()) && !jsonObj.get("bhim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bhim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bhim").toString())); + } + if ((jsonObj.get("gpay") != null && !jsonObj.get("gpay").isJsonNull()) && !jsonObj.get("gpay").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gpay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gpay").toString())); + } + if ((jsonObj.get("phonepe") != null && !jsonObj.get("phonepe").isJsonNull()) && !jsonObj.get("phonepe").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phonepe` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phonepe").toString())); + } + if ((jsonObj.get("qr_code") != null && !jsonObj.get("qr_code").isJsonNull()) && !jsonObj.get("qr_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qr_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qr_code").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateRequestResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateRequestResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateRequestResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateRequestResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateRequestResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateRequestResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateRequestResponseSchema + * @throws IOException if the JSON string is invalid with respect to CreateRequestResponseSchema + */ + public static CreateRequestResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateRequestResponseSchema.class); + } + + /** + * Convert an instance of CreateRequestResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlRequestSchema.java b/src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlRequestSchema.java new file mode 100644 index 0000000..694dcb7 --- /dev/null +++ b/src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlRequestSchema.java @@ -0,0 +1,365 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to create a DigiLocker URL for document verification + */ +@Schema(description = "Find the request parameters to create a DigiLocker URL for document verification") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DigiLockerVerificationCreateUrlRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "ABC00123"; + + /** + * Gets or Sets documentRequested + */ + @JsonAdapter(DocumentRequestedEnum.Adapter.class) + public enum DocumentRequestedEnum { + AADHAAR("AADHAAR"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + DocumentRequestedEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DocumentRequestedEnum fromValue(String value) { + for (DocumentRequestedEnum b : DocumentRequestedEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DocumentRequestedEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DocumentRequestedEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DocumentRequestedEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_DOCUMENT_REQUESTED = "document_requested"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_REQUESTED) + private List documentRequested = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REDIRECT_URL = "redirect_url"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URL) + private String redirectUrl = "https://www.cashfree.com"; + + public DigiLockerVerificationCreateUrlRequestSchema() { + } + + public DigiLockerVerificationCreateUrlRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the API request. The maximum character limit is 50. Alphanumeric, period (.), hyphen (-). and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the API request. The maximum character limit is 50. Alphanumeric, period (.), hyphen (-). and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public DigiLockerVerificationCreateUrlRequestSchema documentRequested(List documentRequested) { + + this.documentRequested = documentRequested; + return this; + } + + public DigiLockerVerificationCreateUrlRequestSchema addDocumentRequestedItem(DocumentRequestedEnum documentRequestedItem) { + if (this.documentRequested == null) { + this.documentRequested = new ArrayList<>(); + } + this.documentRequested.add(documentRequestedItem); + return this; + } + + /** + * It is the list of customer documents required for verification. + * @return documentRequested + **/ + @javax.annotation.Nonnull + @Schema(example = "[\"AADHAAR\"]", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the list of customer documents required for verification.") + public List getDocumentRequested() { + return documentRequested; + } + + + public void setDocumentRequested(List documentRequested) { + this.documentRequested = documentRequested; + } + + + public DigiLockerVerificationCreateUrlRequestSchema redirectUrl(String redirectUrl) { + + this.redirectUrl = redirectUrl; + return this; + } + + /** + * It is the URL that you need to provide that takes the user to after completing the DigiLocker journey. It will contain the verification_id that can be used to get the status of the verification. + * @return redirectUrl + **/ + @javax.annotation.Nullable + @Schema(example = "https://www.cashfree.com", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the URL that you need to provide that takes the user to after completing the DigiLocker journey. It will contain the verification_id that can be used to get the status of the verification.") + public String getRedirectUrl() { + return redirectUrl; + } + + + public void setRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DigiLockerVerificationCreateUrlRequestSchema digiLockerVerificationCreateUrlRequestSchema = (DigiLockerVerificationCreateUrlRequestSchema) o; + return Objects.equals(this.verificationId, digiLockerVerificationCreateUrlRequestSchema.verificationId) && + Objects.equals(this.documentRequested, digiLockerVerificationCreateUrlRequestSchema.documentRequested) && + Objects.equals(this.redirectUrl, digiLockerVerificationCreateUrlRequestSchema.redirectUrl); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, documentRequested, redirectUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DigiLockerVerificationCreateUrlRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" documentRequested: ").append(toIndentedString(documentRequested)).append("\n"); + sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("document_requested"); + openapiFields.add("redirect_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("document_requested"); + } + + /** + * 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 DigiLockerVerificationCreateUrlRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DigiLockerVerificationCreateUrlRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + // ensure the required json array is present + if (jsonObj.get("document_requested") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("document_requested").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_requested` to be an array in the JSON string but got `%s`", jsonObj.get("document_requested").toString())); + } + if ((jsonObj.get("redirect_url") != null && !jsonObj.get("redirect_url").isJsonNull()) && !jsonObj.get("redirect_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_url").toString())); + } + } + + + /** + * 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 DigiLockerVerificationCreateUrlRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DigiLockerVerificationCreateUrlRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + // ensure the required json array is present + if (jsonObj.get("document_requested") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("document_requested").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_requested` to be an array in the JSON string but got `%s`", jsonObj.get("document_requested").toString())); + } + if ((jsonObj.get("redirect_url") != null && !jsonObj.get("redirect_url").isJsonNull()) && !jsonObj.get("redirect_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_url").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DigiLockerVerificationCreateUrlRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DigiLockerVerificationCreateUrlRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DigiLockerVerificationCreateUrlRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DigiLockerVerificationCreateUrlRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DigiLockerVerificationCreateUrlRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DigiLockerVerificationCreateUrlRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of DigiLockerVerificationCreateUrlRequestSchema + * @throws IOException if the JSON string is invalid with respect to DigiLockerVerificationCreateUrlRequestSchema + */ + public static DigiLockerVerificationCreateUrlRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DigiLockerVerificationCreateUrlRequestSchema.class); + } + + /** + * Convert an instance of DigiLockerVerificationCreateUrlRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlResponseSchema.java b/src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlResponseSchema.java new file mode 100644 index 0000000..fdfe162 --- /dev/null +++ b/src/main/java/com/cashfree/model/DigiLockerVerificationCreateUrlResponseSchema.java @@ -0,0 +1,397 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for creating a DigiLocker URL for document verification + */ +@Schema(description = "Success response for creating a DigiLocker URL for document verification") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DigiLockerVerificationCreateUrlResponseSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DOCUMENT_REQUESTED = "document_requested"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_REQUESTED) + private List documentRequested; + + public static final String SERIALIZED_NAME_REDIRECT_URL = "redirect_url"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URL) + private String redirectUrl; + + public DigiLockerVerificationCreateUrlResponseSchema() { + } + + public DigiLockerVerificationCreateUrlResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify this API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify this API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public DigiLockerVerificationCreateUrlResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "12345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public DigiLockerVerificationCreateUrlResponseSchema url(String url) { + + this.url = url; + return this; + } + + /** + * It displays the URL received to retrieve and verify aadhaar information from DigiLocker. + * @return url + **/ + @javax.annotation.Nullable + @Schema(example = "DIGILOCKER_URL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the URL received to retrieve and verify aadhaar information from DigiLocker.") + public String getUrl() { + return url; + } + + + public void setUrl(String url) { + this.url = url; + } + + + public DigiLockerVerificationCreateUrlResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the verification request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "PENDING", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the verification request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public DigiLockerVerificationCreateUrlResponseSchema documentRequested(List documentRequested) { + + this.documentRequested = documentRequested; + return this; + } + + public DigiLockerVerificationCreateUrlResponseSchema addDocumentRequestedItem(String documentRequestedItem) { + if (this.documentRequested == null) { + this.documentRequested = new ArrayList<>(); + } + this.documentRequested.add(documentRequestedItem); + return this; + } + + /** + * It displays the list of documents requested for verification. + * @return documentRequested + **/ + @javax.annotation.Nullable + @Schema(example = "[\"AADHAAR\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the list of documents requested for verification.") + public List getDocumentRequested() { + return documentRequested; + } + + + public void setDocumentRequested(List documentRequested) { + this.documentRequested = documentRequested; + } + + + public DigiLockerVerificationCreateUrlResponseSchema redirectUrl(String redirectUrl) { + + this.redirectUrl = redirectUrl; + return this; + } + + /** + * It displays the URL entered in the request that takes the user to after completing the DigiLocker journey. + * @return redirectUrl + **/ + @javax.annotation.Nullable + @Schema(example = "REDIRECT_URL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the URL entered in the request that takes the user to after completing the DigiLocker journey. ") + public String getRedirectUrl() { + return redirectUrl; + } + + + public void setRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DigiLockerVerificationCreateUrlResponseSchema digiLockerVerificationCreateUrlResponseSchema = (DigiLockerVerificationCreateUrlResponseSchema) o; + return Objects.equals(this.verificationId, digiLockerVerificationCreateUrlResponseSchema.verificationId) && + Objects.equals(this.referenceId, digiLockerVerificationCreateUrlResponseSchema.referenceId) && + Objects.equals(this.url, digiLockerVerificationCreateUrlResponseSchema.url) && + Objects.equals(this.status, digiLockerVerificationCreateUrlResponseSchema.status) && + Objects.equals(this.documentRequested, digiLockerVerificationCreateUrlResponseSchema.documentRequested) && + Objects.equals(this.redirectUrl, digiLockerVerificationCreateUrlResponseSchema.redirectUrl); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, referenceId, url, status, documentRequested, redirectUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DigiLockerVerificationCreateUrlResponseSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" documentRequested: ").append(toIndentedString(documentRequested)).append("\n"); + sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("url"); + openapiFields.add("status"); + openapiFields.add("document_requested"); + openapiFields.add("redirect_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DigiLockerVerificationCreateUrlResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("document_requested") != null && !jsonObj.get("document_requested").isJsonNull() && !jsonObj.get("document_requested").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_requested` to be an array in the JSON string but got `%s`", jsonObj.get("document_requested").toString())); + } + if ((jsonObj.get("redirect_url") != null && !jsonObj.get("redirect_url").isJsonNull()) && !jsonObj.get("redirect_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_url").toString())); + } + } + + + /** + * 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 DigiLockerVerificationCreateUrlResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("document_requested") != null && !jsonObj.get("document_requested").isJsonNull() && !jsonObj.get("document_requested").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_requested` to be an array in the JSON string but got `%s`", jsonObj.get("document_requested").toString())); + } + if ((jsonObj.get("redirect_url") != null && !jsonObj.get("redirect_url").isJsonNull()) && !jsonObj.get("redirect_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_url").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DigiLockerVerificationCreateUrlResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DigiLockerVerificationCreateUrlResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DigiLockerVerificationCreateUrlResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DigiLockerVerificationCreateUrlResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DigiLockerVerificationCreateUrlResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DigiLockerVerificationCreateUrlResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of DigiLockerVerificationCreateUrlResponseSchema + * @throws IOException if the JSON string is invalid with respect to DigiLockerVerificationCreateUrlResponseSchema + */ + public static DigiLockerVerificationCreateUrlResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DigiLockerVerificationCreateUrlResponseSchema.class); + } + + /** + * Convert an instance of DigiLockerVerificationCreateUrlResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchema.java b/src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchema.java new file mode 100644 index 0000000..2794eb7 --- /dev/null +++ b/src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchema.java @@ -0,0 +1,494 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.DigiLockerVerificationGetDocumentResponseSchemaSplitAddress; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Get DigiLocker Document API + */ +@Schema(description = "Success response for Get DigiLocker Document API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DigiLockerVerificationGetDocumentResponseSchema { + public static final String SERIALIZED_NAME_CARE_OF = "care_of"; + @SerializedName(SERIALIZED_NAME_CARE_OF) + private String careOf; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PHOTO_LINK = "photo_link"; + @SerializedName(SERIALIZED_NAME_PHOTO_LINK) + private String photoLink; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_SPLIT_ADDRESS = "split_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_ADDRESS) + private DigiLockerVerificationGetDocumentResponseSchemaSplitAddress splitAddress; + + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + private String uid; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public DigiLockerVerificationGetDocumentResponseSchema() { + } + + public DigiLockerVerificationGetDocumentResponseSchema careOf(String careOf) { + + this.careOf = careOf; + return this; + } + + /** + * It displays the name of the parent or guardian. + * @return careOf + **/ + @javax.annotation.Nullable + @Schema(example = "John Snow", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the parent or guardian.") + public String getCareOf() { + return careOf; + } + + + public void setCareOf(String careOf) { + this.careOf = careOf; + } + + + public DigiLockerVerificationGetDocumentResponseSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the individual. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "02-02-1995", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the individual.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public DigiLockerVerificationGetDocumentResponseSchema gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the individual. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "M", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the individual.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public DigiLockerVerificationGetDocumentResponseSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the individual. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the individual.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public DigiLockerVerificationGetDocumentResponseSchema photoLink(String photoLink) { + + this.photoLink = photoLink; + return this; + } + + /** + * It displays the link to the photo of the individual present in the document. + * @return photoLink + **/ + @javax.annotation.Nullable + @Schema(example = "PHOTO_LINK", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the link to the photo of the individual present in the document.") + public String getPhotoLink() { + return photoLink; + } + + + public void setPhotoLink(String photoLink) { + this.photoLink = photoLink; + } + + + public DigiLockerVerificationGetDocumentResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1234", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public DigiLockerVerificationGetDocumentResponseSchema splitAddress(DigiLockerVerificationGetDocumentResponseSchemaSplitAddress splitAddress) { + + this.splitAddress = splitAddress; + return this; + } + + /** + * Get splitAddress + * @return splitAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress getSplitAddress() { + return splitAddress; + } + + + public void setSplitAddress(DigiLockerVerificationGetDocumentResponseSchemaSplitAddress splitAddress) { + this.splitAddress = splitAddress; + } + + + public DigiLockerVerificationGetDocumentResponseSchema uid(String uid) { + + this.uid = uid; + return this; + } + + /** + * It displays the unique number assigned to the individual when applying for the aadhaar card.] + * @return uid + **/ + @javax.annotation.Nullable + @Schema(example = "xxxxxxxx5678", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique number assigned to the individual when applying for the aadhaar card.]") + public String getUid() { + return uid; + } + + + public void setUid(String uid) { + this.uid = uid; + } + + + public DigiLockerVerificationGetDocumentResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DigiLockerVerificationGetDocumentResponseSchema digiLockerVerificationGetDocumentResponseSchema = (DigiLockerVerificationGetDocumentResponseSchema) o; + return Objects.equals(this.careOf, digiLockerVerificationGetDocumentResponseSchema.careOf) && + Objects.equals(this.dob, digiLockerVerificationGetDocumentResponseSchema.dob) && + Objects.equals(this.gender, digiLockerVerificationGetDocumentResponseSchema.gender) && + Objects.equals(this.name, digiLockerVerificationGetDocumentResponseSchema.name) && + Objects.equals(this.photoLink, digiLockerVerificationGetDocumentResponseSchema.photoLink) && + Objects.equals(this.referenceId, digiLockerVerificationGetDocumentResponseSchema.referenceId) && + Objects.equals(this.splitAddress, digiLockerVerificationGetDocumentResponseSchema.splitAddress) && + Objects.equals(this.uid, digiLockerVerificationGetDocumentResponseSchema.uid) && + Objects.equals(this.verificationId, digiLockerVerificationGetDocumentResponseSchema.verificationId); + } + + @Override + public int hashCode() { + return Objects.hash(careOf, dob, gender, name, photoLink, referenceId, splitAddress, uid, verificationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DigiLockerVerificationGetDocumentResponseSchema {\n"); + sb.append(" careOf: ").append(toIndentedString(careOf)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoLink: ").append(toIndentedString(photoLink)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" splitAddress: ").append(toIndentedString(splitAddress)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("care_of"); + openapiFields.add("dob"); + openapiFields.add("gender"); + openapiFields.add("name"); + openapiFields.add("photo_link"); + openapiFields.add("reference_id"); + openapiFields.add("split_address"); + openapiFields.add("uid"); + openapiFields.add("verification_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DigiLockerVerificationGetDocumentResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("care_of") != null && !jsonObj.get("care_of").isJsonNull()) && !jsonObj.get("care_of").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `care_of` to be a primitive type in the JSON string but got `%s`", jsonObj.get("care_of").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("photo_link") != null && !jsonObj.get("photo_link").isJsonNull()) && !jsonObj.get("photo_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `photo_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("photo_link").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.validateJsonElement(jsonObj.get("split_address")); + } + if ((jsonObj.get("uid") != null && !jsonObj.get("uid").isJsonNull()) && !jsonObj.get("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 DigiLockerVerificationGetDocumentResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("care_of") != null && !jsonObj.get("care_of").isJsonNull()) && !jsonObj.get("care_of").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `care_of` to be a primitive type in the JSON string but got `%s`", jsonObj.get("care_of").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("photo_link") != null && !jsonObj.get("photo_link").isJsonNull()) && !jsonObj.get("photo_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `photo_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("photo_link").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.validateJsonElement(jsonObj.get("split_address")); + return true; + } + if ((jsonObj.get("uid") != null && !jsonObj.get("uid").isJsonNull()) && !jsonObj.get("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DigiLockerVerificationGetDocumentResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DigiLockerVerificationGetDocumentResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DigiLockerVerificationGetDocumentResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DigiLockerVerificationGetDocumentResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DigiLockerVerificationGetDocumentResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DigiLockerVerificationGetDocumentResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of DigiLockerVerificationGetDocumentResponseSchema + * @throws IOException if the JSON string is invalid with respect to DigiLockerVerificationGetDocumentResponseSchema + */ + public static DigiLockerVerificationGetDocumentResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DigiLockerVerificationGetDocumentResponseSchema.class); + } + + /** + * Convert an instance of DigiLockerVerificationGetDocumentResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.java b/src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.java new file mode 100644 index 0000000..00f2508 --- /dev/null +++ b/src/main/java/com/cashfree/model/DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.java @@ -0,0 +1,531 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the address information in individual components. + */ +@Schema(description = "It contains the address information in individual components.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DigiLockerVerificationGetDocumentResponseSchemaSplitAddress { + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_DIST = "dist"; + @SerializedName(SERIALIZED_NAME_DIST) + private String dist; + + public static final String SERIALIZED_NAME_HOUSE = "house"; + @SerializedName(SERIALIZED_NAME_HOUSE) + private String house; + + public static final String SERIALIZED_NAME_LANDMARK = "landmark"; + @SerializedName(SERIALIZED_NAME_LANDMARK) + private String landmark; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_PO = "po"; + @SerializedName(SERIALIZED_NAME_PO) + private String po; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_STREET = "street"; + @SerializedName(SERIALIZED_NAME_STREET) + private String street; + + public static final String SERIALIZED_NAME_SUBDIST = "subdist"; + @SerializedName(SERIALIZED_NAME_SUBDIST) + private String subdist; + + public static final String SERIALIZED_NAME_VTC = "vtc"; + @SerializedName(SERIALIZED_NAME_VTC) + private String vtc; + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress() { + } + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress country(String country) { + + this.country = country; + return this; + } + + /** + * It displays the name of the country as present in the document. + * @return country + **/ + @javax.annotation.Nullable + @Schema(example = "India", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the country as present in the document.") + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress dist(String dist) { + + this.dist = dist; + return this; + } + + /** + * It displays the name of the district as present in the document. + * @return dist + **/ + @javax.annotation.Nullable + @Schema(example = "Haveri", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the district as present in the document.") + public String getDist() { + return dist; + } + + + public void setDist(String dist) { + this.dist = dist; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress house(String house) { + + this.house = house; + return this; + } + + /** + * It displays the name of the house as present in the document. + * @return house + **/ + @javax.annotation.Nullable + @Schema(example = "House", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the house as present in the document.") + public String getHouse() { + return house; + } + + + public void setHouse(String house) { + this.house = house; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress landmark(String landmark) { + + this.landmark = landmark; + return this; + } + + /** + * It displays the name of the landmark as present in the document. + * @return landmark + **/ + @javax.annotation.Nullable + @Schema(example = "Landmark", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the landmark as present in the document.") + public String getLandmark() { + return landmark; + } + + + public void setLandmark(String landmark) { + this.landmark = landmark; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code as present in the document. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "581112", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code as present in the document.") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress po(String po) { + + this.po = po; + return this; + } + + /** + * It displays the name of the post office as present in the document. + * @return po + **/ + @javax.annotation.Nullable + @Schema(example = "Post Office", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the post office as present in the document.") + public String getPo() { + return po; + } + + + public void setPo(String po) { + this.po = po; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the name of the state as present in the document. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "State", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state as present in the document.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress street(String street) { + + this.street = street; + return this; + } + + /** + * It displays the name of the street as present in the document. + * @return street + **/ + @javax.annotation.Nullable + @Schema(example = "Street", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the street as present in the document.") + public String getStreet() { + return street; + } + + + public void setStreet(String street) { + this.street = street; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress subdist(String subdist) { + + this.subdist = subdist; + return this; + } + + /** + * It displays the name of the sub district as present in the document. + * @return subdist + **/ + @javax.annotation.Nullable + @Schema(example = "SubDist", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the sub district as present in the document.") + public String getSubdist() { + return subdist; + } + + + public void setSubdist(String subdist) { + this.subdist = subdist; + } + + + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress vtc(String vtc) { + + this.vtc = vtc; + return this; + } + + /** + * It displays the name of the VTC (village, town, city) as present in the address. + * @return vtc + **/ + @javax.annotation.Nullable + @Schema(example = "Vtc", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the VTC (village, town, city) as present in the address.") + public String getVtc() { + return vtc; + } + + + public void setVtc(String vtc) { + this.vtc = vtc; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DigiLockerVerificationGetDocumentResponseSchemaSplitAddress digiLockerVerificationGetDocumentResponseSchemaSplitAddress = (DigiLockerVerificationGetDocumentResponseSchemaSplitAddress) o; + return Objects.equals(this.country, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.country) && + Objects.equals(this.dist, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.dist) && + Objects.equals(this.house, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.house) && + Objects.equals(this.landmark, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.landmark) && + Objects.equals(this.pincode, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.pincode) && + Objects.equals(this.po, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.po) && + Objects.equals(this.state, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.state) && + Objects.equals(this.street, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.street) && + Objects.equals(this.subdist, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.subdist) && + Objects.equals(this.vtc, digiLockerVerificationGetDocumentResponseSchemaSplitAddress.vtc); + } + + @Override + public int hashCode() { + return Objects.hash(country, dist, house, landmark, pincode, po, state, street, subdist, vtc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DigiLockerVerificationGetDocumentResponseSchemaSplitAddress {\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" dist: ").append(toIndentedString(dist)).append("\n"); + sb.append(" house: ").append(toIndentedString(house)).append("\n"); + sb.append(" landmark: ").append(toIndentedString(landmark)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" po: ").append(toIndentedString(po)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).append("\n"); + sb.append(" subdist: ").append(toIndentedString(subdist)).append("\n"); + sb.append(" vtc: ").append(toIndentedString(vtc)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("country"); + openapiFields.add("dist"); + openapiFields.add("house"); + openapiFields.add("landmark"); + openapiFields.add("pincode"); + openapiFields.add("po"); + openapiFields.add("state"); + openapiFields.add("street"); + openapiFields.add("subdist"); + openapiFields.add("vtc"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DigiLockerVerificationGetDocumentResponseSchemaSplitAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("dist") != null && !jsonObj.get("dist").isJsonNull()) && !jsonObj.get("dist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dist").toString())); + } + if ((jsonObj.get("house") != null && !jsonObj.get("house").isJsonNull()) && !jsonObj.get("house").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `house` to be a primitive type in the JSON string but got `%s`", jsonObj.get("house").toString())); + } + if ((jsonObj.get("landmark") != null && !jsonObj.get("landmark").isJsonNull()) && !jsonObj.get("landmark").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `landmark` to be a primitive type in the JSON string but got `%s`", jsonObj.get("landmark").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("po") != null && !jsonObj.get("po").isJsonNull()) && !jsonObj.get("po").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `po` to be a primitive type in the JSON string but got `%s`", jsonObj.get("po").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("street") != null && !jsonObj.get("street").isJsonNull()) && !jsonObj.get("street").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + if ((jsonObj.get("subdist") != null && !jsonObj.get("subdist").isJsonNull()) && !jsonObj.get("subdist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subdist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subdist").toString())); + } + if ((jsonObj.get("vtc") != null && !jsonObj.get("vtc").isJsonNull()) && !jsonObj.get("vtc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vtc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vtc").toString())); + } + } + + + /** + * 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 DigiLockerVerificationGetDocumentResponseSchemaSplitAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("dist") != null && !jsonObj.get("dist").isJsonNull()) && !jsonObj.get("dist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dist").toString())); + } + if ((jsonObj.get("house") != null && !jsonObj.get("house").isJsonNull()) && !jsonObj.get("house").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `house` to be a primitive type in the JSON string but got `%s`", jsonObj.get("house").toString())); + } + if ((jsonObj.get("landmark") != null && !jsonObj.get("landmark").isJsonNull()) && !jsonObj.get("landmark").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `landmark` to be a primitive type in the JSON string but got `%s`", jsonObj.get("landmark").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("po") != null && !jsonObj.get("po").isJsonNull()) && !jsonObj.get("po").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `po` to be a primitive type in the JSON string but got `%s`", jsonObj.get("po").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("street") != null && !jsonObj.get("street").isJsonNull()) && !jsonObj.get("street").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + if ((jsonObj.get("subdist") != null && !jsonObj.get("subdist").isJsonNull()) && !jsonObj.get("subdist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subdist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subdist").toString())); + } + if ((jsonObj.get("vtc") != null && !jsonObj.get("vtc").isJsonNull()) && !jsonObj.get("vtc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vtc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vtc").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DigiLockerVerificationGetDocumentResponseSchemaSplitAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DigiLockerVerificationGetDocumentResponseSchemaSplitAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DigiLockerVerificationGetDocumentResponseSchemaSplitAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DigiLockerVerificationGetDocumentResponseSchemaSplitAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of DigiLockerVerificationGetDocumentResponseSchemaSplitAddress + * @throws IOException if the JSON string is invalid with respect to DigiLockerVerificationGetDocumentResponseSchemaSplitAddress + */ + public static DigiLockerVerificationGetDocumentResponseSchemaSplitAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DigiLockerVerificationGetDocumentResponseSchemaSplitAddress.class); + } + + /** + * Convert an instance of DigiLockerVerificationGetDocumentResponseSchemaSplitAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchema.java b/src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchema.java new file mode 100644 index 0000000..0a1dc61 --- /dev/null +++ b/src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchema.java @@ -0,0 +1,411 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.DigiLockerVerificationGetStatusResponseSchemaUserDetails; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response of Get DigiLocker Verification Status + */ +@Schema(description = "Success response of Get DigiLocker Verification Status") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DigiLockerVerificationGetStatusResponseSchema { + public static final String SERIALIZED_NAME_USER_DETAILS = "user_details"; + @SerializedName(SERIALIZED_NAME_USER_DETAILS) + private DigiLockerVerificationGetStatusResponseSchemaUserDetails userDetails; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DOCUMENT_REQUESTED = "document_requested"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_REQUESTED) + private List documentRequested; + + public static final String SERIALIZED_NAME_DOCUMENT_CONSENT = "document_consent"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_CONSENT) + private List documentConsent; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public DigiLockerVerificationGetStatusResponseSchema() { + } + + public DigiLockerVerificationGetStatusResponseSchema userDetails(DigiLockerVerificationGetStatusResponseSchemaUserDetails userDetails) { + + this.userDetails = userDetails; + return this; + } + + /** + * Get userDetails + * @return userDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public DigiLockerVerificationGetStatusResponseSchemaUserDetails getUserDetails() { + return userDetails; + } + + + public void setUserDetails(DigiLockerVerificationGetStatusResponseSchemaUserDetails userDetails) { + this.userDetails = userDetails; + } + + + public DigiLockerVerificationGetStatusResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "PENDING", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public DigiLockerVerificationGetStatusResponseSchema documentRequested(List documentRequested) { + + this.documentRequested = documentRequested; + return this; + } + + public DigiLockerVerificationGetStatusResponseSchema addDocumentRequestedItem(String documentRequestedItem) { + if (this.documentRequested == null) { + this.documentRequested = new ArrayList<>(); + } + this.documentRequested.add(documentRequestedItem); + return this; + } + + /** + * It contains the information of the requested document(s) for verification. + * @return documentRequested + **/ + @javax.annotation.Nullable + @Schema(example = "[\"AADHAAR\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It contains the information of the requested document(s) for verification.") + public List getDocumentRequested() { + return documentRequested; + } + + + public void setDocumentRequested(List documentRequested) { + this.documentRequested = documentRequested; + } + + + public DigiLockerVerificationGetStatusResponseSchema documentConsent(List documentConsent) { + + this.documentConsent = documentConsent; + return this; + } + + public DigiLockerVerificationGetStatusResponseSchema addDocumentConsentItem(String documentConsentItem) { + if (this.documentConsent == null) { + this.documentConsent = new ArrayList<>(); + } + this.documentConsent.add(documentConsentItem); + return this; + } + + /** + * It displays the consent of the individual(user) for document verification. + * @return documentConsent + **/ + @javax.annotation.Nullable + @Schema(example = "[\"AADHAAR\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the consent of the individual(user) for document verification.") + public List getDocumentConsent() { + return documentConsent; + } + + + public void setDocumentConsent(List documentConsent) { + this.documentConsent = documentConsent; + } + + + public DigiLockerVerificationGetStatusResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public DigiLockerVerificationGetStatusResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1234", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DigiLockerVerificationGetStatusResponseSchema digiLockerVerificationGetStatusResponseSchema = (DigiLockerVerificationGetStatusResponseSchema) o; + return Objects.equals(this.userDetails, digiLockerVerificationGetStatusResponseSchema.userDetails) && + Objects.equals(this.status, digiLockerVerificationGetStatusResponseSchema.status) && + Objects.equals(this.documentRequested, digiLockerVerificationGetStatusResponseSchema.documentRequested) && + Objects.equals(this.documentConsent, digiLockerVerificationGetStatusResponseSchema.documentConsent) && + Objects.equals(this.verificationId, digiLockerVerificationGetStatusResponseSchema.verificationId) && + Objects.equals(this.referenceId, digiLockerVerificationGetStatusResponseSchema.referenceId); + } + + @Override + public int hashCode() { + return Objects.hash(userDetails, status, documentRequested, documentConsent, verificationId, referenceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DigiLockerVerificationGetStatusResponseSchema {\n"); + sb.append(" userDetails: ").append(toIndentedString(userDetails)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" documentRequested: ").append(toIndentedString(documentRequested)).append("\n"); + sb.append(" documentConsent: ").append(toIndentedString(documentConsent)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_details"); + openapiFields.add("status"); + openapiFields.add("document_requested"); + openapiFields.add("document_consent"); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DigiLockerVerificationGetStatusResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `user_details` + if (jsonObj.get("user_details") != null && !jsonObj.get("user_details").isJsonNull()) { + DigiLockerVerificationGetStatusResponseSchemaUserDetails.validateJsonElement(jsonObj.get("user_details")); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("document_requested") != null && !jsonObj.get("document_requested").isJsonNull() && !jsonObj.get("document_requested").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_requested` to be an array in the JSON string but got `%s`", jsonObj.get("document_requested").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("document_consent") != null && !jsonObj.get("document_consent").isJsonNull() && !jsonObj.get("document_consent").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_consent` to be an array in the JSON string but got `%s`", jsonObj.get("document_consent").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 DigiLockerVerificationGetStatusResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `user_details` + if (jsonObj.get("user_details") != null && !jsonObj.get("user_details").isJsonNull()) { + DigiLockerVerificationGetStatusResponseSchemaUserDetails.validateJsonElement(jsonObj.get("user_details")); + return true; + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("document_requested") != null && !jsonObj.get("document_requested").isJsonNull() && !jsonObj.get("document_requested").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_requested` to be an array in the JSON string but got `%s`", jsonObj.get("document_requested").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("document_consent") != null && !jsonObj.get("document_consent").isJsonNull() && !jsonObj.get("document_consent").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `document_consent` to be an array in the JSON string but got `%s`", jsonObj.get("document_consent").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DigiLockerVerificationGetStatusResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DigiLockerVerificationGetStatusResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DigiLockerVerificationGetStatusResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DigiLockerVerificationGetStatusResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DigiLockerVerificationGetStatusResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DigiLockerVerificationGetStatusResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of DigiLockerVerificationGetStatusResponseSchema + * @throws IOException if the JSON string is invalid with respect to DigiLockerVerificationGetStatusResponseSchema + */ + public static DigiLockerVerificationGetStatusResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DigiLockerVerificationGetStatusResponseSchema.class); + } + + /** + * Convert an instance of DigiLockerVerificationGetStatusResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchemaUserDetails.java b/src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchemaUserDetails.java new file mode 100644 index 0000000..a965843 --- /dev/null +++ b/src/main/java/com/cashfree/model/DigiLockerVerificationGetStatusResponseSchemaUserDetails.java @@ -0,0 +1,356 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It displays the details of the individual(user). + */ +@Schema(description = "It displays the details of the individual(user).") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DigiLockerVerificationGetStatusResponseSchemaUserDetails { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_EAADHAAR = "eaadhaar"; + @SerializedName(SERIALIZED_NAME_EAADHAAR) + private String eaadhaar; + + public static final String SERIALIZED_NAME_MOBILE = "mobile"; + @SerializedName(SERIALIZED_NAME_MOBILE) + private String mobile; + + public DigiLockerVerificationGetStatusResponseSchemaUserDetails() { + } + + public DigiLockerVerificationGetStatusResponseSchemaUserDetails name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the individual. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the individual.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public DigiLockerVerificationGetStatusResponseSchemaUserDetails dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the individual. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "02-02-1995", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the individual.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public DigiLockerVerificationGetStatusResponseSchemaUserDetails gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the individual. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "M", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the individual.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public DigiLockerVerificationGetStatusResponseSchemaUserDetails eaadhaar(String eaadhaar) { + + this.eaadhaar = eaadhaar; + return this; + } + + /** + * It displays the e aadhaar availability of the individual. + * @return eaadhaar + **/ + @javax.annotation.Nullable + @Schema(example = "Y", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the e aadhaar availability of the individual.") + public String getEaadhaar() { + return eaadhaar; + } + + + public void setEaadhaar(String eaadhaar) { + this.eaadhaar = eaadhaar; + } + + + public DigiLockerVerificationGetStatusResponseSchemaUserDetails mobile(String mobile) { + + this.mobile = mobile; + return this; + } + + /** + * It displays the mobile number of the individual. + * @return mobile + **/ + @javax.annotation.Nullable + @Schema(example = "9999999999", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the mobile number of the individual.") + public String getMobile() { + return mobile; + } + + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DigiLockerVerificationGetStatusResponseSchemaUserDetails digiLockerVerificationGetStatusResponseSchemaUserDetails = (DigiLockerVerificationGetStatusResponseSchemaUserDetails) o; + return Objects.equals(this.name, digiLockerVerificationGetStatusResponseSchemaUserDetails.name) && + Objects.equals(this.dob, digiLockerVerificationGetStatusResponseSchemaUserDetails.dob) && + Objects.equals(this.gender, digiLockerVerificationGetStatusResponseSchemaUserDetails.gender) && + Objects.equals(this.eaadhaar, digiLockerVerificationGetStatusResponseSchemaUserDetails.eaadhaar) && + Objects.equals(this.mobile, digiLockerVerificationGetStatusResponseSchemaUserDetails.mobile); + } + + @Override + public int hashCode() { + return Objects.hash(name, dob, gender, eaadhaar, mobile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DigiLockerVerificationGetStatusResponseSchemaUserDetails {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" eaadhaar: ").append(toIndentedString(eaadhaar)).append("\n"); + sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("dob"); + openapiFields.add("gender"); + openapiFields.add("eaadhaar"); + openapiFields.add("mobile"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DigiLockerVerificationGetStatusResponseSchemaUserDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("eaadhaar") != null && !jsonObj.get("eaadhaar").isJsonNull()) && !jsonObj.get("eaadhaar").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `eaadhaar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eaadhaar").toString())); + } + if ((jsonObj.get("mobile") != null && !jsonObj.get("mobile").isJsonNull()) && !jsonObj.get("mobile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile").toString())); + } + } + + + /** + * 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 DigiLockerVerificationGetStatusResponseSchemaUserDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("eaadhaar") != null && !jsonObj.get("eaadhaar").isJsonNull()) && !jsonObj.get("eaadhaar").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `eaadhaar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eaadhaar").toString())); + } + if ((jsonObj.get("mobile") != null && !jsonObj.get("mobile").isJsonNull()) && !jsonObj.get("mobile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DigiLockerVerificationGetStatusResponseSchemaUserDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DigiLockerVerificationGetStatusResponseSchemaUserDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DigiLockerVerificationGetStatusResponseSchemaUserDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DigiLockerVerificationGetStatusResponseSchemaUserDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DigiLockerVerificationGetStatusResponseSchemaUserDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DigiLockerVerificationGetStatusResponseSchemaUserDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of DigiLockerVerificationGetStatusResponseSchemaUserDetails + * @throws IOException if the JSON string is invalid with respect to DigiLockerVerificationGetStatusResponseSchemaUserDetails + */ + public static DigiLockerVerificationGetStatusResponseSchemaUserDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DigiLockerVerificationGetStatusResponseSchemaUserDetails.class); + } + + /** + * Convert an instance of DigiLockerVerificationGetStatusResponseSchemaUserDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DrivingLicenceDetails.java b/src/main/java/com/cashfree/model/DrivingLicenceDetails.java new file mode 100644 index 0000000..73724d8 --- /dev/null +++ b/src/main/java/com/cashfree/model/DrivingLicenceDetails.java @@ -0,0 +1,561 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AddressDetails; +import com.cashfree.model.DrivingLicenceDetailsSplitAddress; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the details of the driving licence. + */ +@Schema(description = "It contains the details of the driving licence.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DrivingLicenceDetails { + public static final String SERIALIZED_NAME_DATE_OF_ISSUE = "date_of_issue"; + @SerializedName(SERIALIZED_NAME_DATE_OF_ISSUE) + private LocalDate dateOfIssue; + + public static final String SERIALIZED_NAME_DATE_OF_LAST_TRANSACTION = "date_of_last_transaction"; + @SerializedName(SERIALIZED_NAME_DATE_OF_LAST_TRANSACTION) + private LocalDate dateOfLastTransaction; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_LAST_TRANSACTED_AT = "last_transacted_at"; + @SerializedName(SERIALIZED_NAME_LAST_TRANSACTED_AT) + private LocalDate lastTransactedAt; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FATHER_OR_HUSBAND_NAME = "father_or_husband_name"; + @SerializedName(SERIALIZED_NAME_FATHER_OR_HUSBAND_NAME) + private String fatherOrHusbandName; + + public static final String SERIALIZED_NAME_ADDRESS_LIST = "address_list"; + @SerializedName(SERIALIZED_NAME_ADDRESS_LIST) + private List addressList; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_SPLIT_ADDRESS = "split_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_ADDRESS) + private DrivingLicenceDetailsSplitAddress splitAddress; + + public static final String SERIALIZED_NAME_COV_DETAILS = "cov_details"; + @SerializedName(SERIALIZED_NAME_COV_DETAILS) + private List covDetails; + + public DrivingLicenceDetails() { + } + + public DrivingLicenceDetails dateOfIssue(LocalDate dateOfIssue) { + + this.dateOfIssue = dateOfIssue; + return this; + } + + /** + * Get dateOfIssue + * @return dateOfIssue + **/ + @javax.annotation.Nullable + @Schema(example = "Mon Oct 23 00:00:00 UTC 2023", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public LocalDate getDateOfIssue() { + return dateOfIssue; + } + + + public void setDateOfIssue(LocalDate dateOfIssue) { + this.dateOfIssue = dateOfIssue; + } + + + public DrivingLicenceDetails dateOfLastTransaction(LocalDate dateOfLastTransaction) { + + this.dateOfLastTransaction = dateOfLastTransaction; + return this; + } + + /** + * Get dateOfLastTransaction + * @return dateOfLastTransaction + **/ + @javax.annotation.Nullable + @Schema(example = "Mon Oct 23 00:00:00 UTC 2023", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public LocalDate getDateOfLastTransaction() { + return dateOfLastTransaction; + } + + + public void setDateOfLastTransaction(LocalDate dateOfLastTransaction) { + this.dateOfLastTransaction = dateOfLastTransaction; + } + + + public DrivingLicenceDetails status(String status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "ACTIVE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public DrivingLicenceDetails lastTransactedAt(LocalDate lastTransactedAt) { + + this.lastTransactedAt = lastTransactedAt; + return this; + } + + /** + * Get lastTransactedAt + * @return lastTransactedAt + **/ + @javax.annotation.Nullable + @Schema(example = "Mon Oct 23 00:00:00 UTC 2023", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public LocalDate getLastTransactedAt() { + return lastTransactedAt; + } + + + public void setLastTransactedAt(LocalDate lastTransactedAt) { + this.lastTransactedAt = lastTransactedAt; + } + + + public DrivingLicenceDetails name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public DrivingLicenceDetails fatherOrHusbandName(String fatherOrHusbandName) { + + this.fatherOrHusbandName = fatherOrHusbandName; + return this; + } + + /** + * Get fatherOrHusbandName + * @return fatherOrHusbandName + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getFatherOrHusbandName() { + return fatherOrHusbandName; + } + + + public void setFatherOrHusbandName(String fatherOrHusbandName) { + this.fatherOrHusbandName = fatherOrHusbandName; + } + + + public DrivingLicenceDetails addressList(List addressList) { + + this.addressList = addressList; + return this; + } + + public DrivingLicenceDetails addAddressListItem(AddressDetails addressListItem) { + if (this.addressList == null) { + this.addressList = new ArrayList<>(); + } + this.addressList.add(addressListItem); + return this; + } + + /** + * Get addressList + * @return addressList + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getAddressList() { + return addressList; + } + + + public void setAddressList(List addressList) { + this.addressList = addressList; + } + + + public DrivingLicenceDetails address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public DrivingLicenceDetails splitAddress(DrivingLicenceDetailsSplitAddress splitAddress) { + + this.splitAddress = splitAddress; + return this; + } + + /** + * Get splitAddress + * @return splitAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public DrivingLicenceDetailsSplitAddress getSplitAddress() { + return splitAddress; + } + + + public void setSplitAddress(DrivingLicenceDetailsSplitAddress splitAddress) { + this.splitAddress = splitAddress; + } + + + public DrivingLicenceDetails covDetails(List covDetails) { + + this.covDetails = covDetails; + return this; + } + + public DrivingLicenceDetails addCovDetailsItem(Object covDetailsItem) { + if (this.covDetails == null) { + this.covDetails = new ArrayList<>(); + } + this.covDetails.add(covDetailsItem); + return this; + } + + /** + * Get covDetails + * @return covDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getCovDetails() { + return covDetails; + } + + + public void setCovDetails(List covDetails) { + this.covDetails = covDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DrivingLicenceDetails drivingLicenceDetails = (DrivingLicenceDetails) o; + return Objects.equals(this.dateOfIssue, drivingLicenceDetails.dateOfIssue) && + Objects.equals(this.dateOfLastTransaction, drivingLicenceDetails.dateOfLastTransaction) && + Objects.equals(this.status, drivingLicenceDetails.status) && + Objects.equals(this.lastTransactedAt, drivingLicenceDetails.lastTransactedAt) && + Objects.equals(this.name, drivingLicenceDetails.name) && + Objects.equals(this.fatherOrHusbandName, drivingLicenceDetails.fatherOrHusbandName) && + Objects.equals(this.addressList, drivingLicenceDetails.addressList) && + Objects.equals(this.address, drivingLicenceDetails.address) && + Objects.equals(this.splitAddress, drivingLicenceDetails.splitAddress) && + Objects.equals(this.covDetails, drivingLicenceDetails.covDetails); + } + + @Override + public int hashCode() { + return Objects.hash(dateOfIssue, dateOfLastTransaction, status, lastTransactedAt, name, fatherOrHusbandName, addressList, address, splitAddress, covDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DrivingLicenceDetails {\n"); + sb.append(" dateOfIssue: ").append(toIndentedString(dateOfIssue)).append("\n"); + sb.append(" dateOfLastTransaction: ").append(toIndentedString(dateOfLastTransaction)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" lastTransactedAt: ").append(toIndentedString(lastTransactedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fatherOrHusbandName: ").append(toIndentedString(fatherOrHusbandName)).append("\n"); + sb.append(" addressList: ").append(toIndentedString(addressList)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" splitAddress: ").append(toIndentedString(splitAddress)).append("\n"); + sb.append(" covDetails: ").append(toIndentedString(covDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("date_of_issue"); + openapiFields.add("date_of_last_transaction"); + openapiFields.add("status"); + openapiFields.add("last_transacted_at"); + openapiFields.add("name"); + openapiFields.add("father_or_husband_name"); + openapiFields.add("address_list"); + openapiFields.add("address"); + openapiFields.add("split_address"); + openapiFields.add("cov_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DrivingLicenceDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("father_or_husband_name") != null && !jsonObj.get("father_or_husband_name").isJsonNull()) && !jsonObj.get("father_or_husband_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father_or_husband_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father_or_husband_name").toString())); + } + if (jsonObj.get("address_list") != null && !jsonObj.get("address_list").isJsonNull()) { + JsonArray jsonArrayaddressList = jsonObj.getAsJsonArray("address_list"); + if (jsonArrayaddressList != null) { + // ensure the json data is an array + if (!jsonObj.get("address_list").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `address_list` to be an array in the JSON string but got `%s`", jsonObj.get("address_list").toString())); + } + + // validate the optional field `address_list` (array) + for (int i = 0; i < jsonArrayaddressList.size(); i++) { + AddressDetails.validateJsonElement(jsonArrayaddressList.get(i)); + }; + } + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + DrivingLicenceDetailsSplitAddress.validateJsonElement(jsonObj.get("split_address")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("cov_details") != null && !jsonObj.get("cov_details").isJsonNull() && !jsonObj.get("cov_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cov_details` to be an array in the JSON string but got `%s`", jsonObj.get("cov_details").toString())); + } + } + + + /** + * 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 DrivingLicenceDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("father_or_husband_name") != null && !jsonObj.get("father_or_husband_name").isJsonNull()) && !jsonObj.get("father_or_husband_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father_or_husband_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father_or_husband_name").toString())); + } + if (jsonObj.get("address_list") != null && !jsonObj.get("address_list").isJsonNull()) { + JsonArray jsonArrayaddressList = jsonObj.getAsJsonArray("address_list"); + if (jsonArrayaddressList != null) { + // ensure the json data is an array + if (!jsonObj.get("address_list").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `address_list` to be an array in the JSON string but got `%s`", jsonObj.get("address_list").toString())); + } + + // validate the optional field `address_list` (array) + for (int i = 0; i < jsonArrayaddressList.size(); i++) { + AddressDetails.validateJsonElement(jsonArrayaddressList.get(i)); + }; + } + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + DrivingLicenceDetailsSplitAddress.validateJsonElement(jsonObj.get("split_address")); + return true; + } + // ensure the optional json data is an array if present + if (jsonObj.get("cov_details") != null && !jsonObj.get("cov_details").isJsonNull() && !jsonObj.get("cov_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cov_details` to be an array in the JSON string but got `%s`", jsonObj.get("cov_details").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrivingLicenceDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrivingLicenceDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrivingLicenceDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrivingLicenceDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrivingLicenceDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrivingLicenceDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrivingLicenceDetails + * @throws IOException if the JSON string is invalid with respect to DrivingLicenceDetails + */ + public static DrivingLicenceDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrivingLicenceDetails.class); + } + + /** + * Convert an instance of DrivingLicenceDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DrivingLicenceDetailsSplitAddress.java b/src/main/java/com/cashfree/model/DrivingLicenceDetailsSplitAddress.java new file mode 100644 index 0000000..f6460e8 --- /dev/null +++ b/src/main/java/com/cashfree/model/DrivingLicenceDetailsSplitAddress.java @@ -0,0 +1,432 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * DrivingLicenceDetailsSplitAddress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DrivingLicenceDetailsSplitAddress { + public static final String SERIALIZED_NAME_DISTRICT = "district"; + @SerializedName(SERIALIZED_NAME_DISTRICT) + private List district; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private List> state; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private List city; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private List country; + + public static final String SERIALIZED_NAME_ADDRESS_LINE = "address_line"; + @SerializedName(SERIALIZED_NAME_ADDRESS_LINE) + private String addressLine; + + public DrivingLicenceDetailsSplitAddress() { + } + + public DrivingLicenceDetailsSplitAddress district(List district) { + + this.district = district; + return this; + } + + public DrivingLicenceDetailsSplitAddress addDistrictItem(String districtItem) { + if (this.district == null) { + this.district = new ArrayList<>(); + } + this.district.add(districtItem); + return this; + } + + /** + * Get district + * @return district + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getDistrict() { + return district; + } + + + public void setDistrict(List district) { + this.district = district; + } + + + public DrivingLicenceDetailsSplitAddress state(List> state) { + + this.state = state; + return this; + } + + public DrivingLicenceDetailsSplitAddress addStateItem(List stateItem) { + if (this.state == null) { + this.state = new ArrayList<>(); + } + this.state.add(stateItem); + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List> getState() { + return state; + } + + + public void setState(List> state) { + this.state = state; + } + + + public DrivingLicenceDetailsSplitAddress city(List city) { + + this.city = city; + return this; + } + + public DrivingLicenceDetailsSplitAddress addCityItem(String cityItem) { + if (this.city == null) { + this.city = new ArrayList<>(); + } + this.city.add(cityItem); + return this; + } + + /** + * Get city + * @return city + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getCity() { + return city; + } + + + public void setCity(List city) { + this.city = city; + } + + + public DrivingLicenceDetailsSplitAddress pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * Get pincode + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "560102", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public DrivingLicenceDetailsSplitAddress country(List country) { + + this.country = country; + return this; + } + + public DrivingLicenceDetailsSplitAddress addCountryItem(String countryItem) { + if (this.country == null) { + this.country = new ArrayList<>(); + } + this.country.add(countryItem); + return this; + } + + /** + * Get country + * @return country + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getCountry() { + return country; + } + + + public void setCountry(List country) { + this.country = country; + } + + + public DrivingLicenceDetailsSplitAddress addressLine(String addressLine) { + + this.addressLine = addressLine; + return this; + } + + /** + * Get addressLine + * @return addressLine + **/ + @javax.annotation.Nullable + @Schema(example = "S-90 SunTower, GopiNagar, Banaglore, KA - 560109", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getAddressLine() { + return addressLine; + } + + + public void setAddressLine(String addressLine) { + this.addressLine = addressLine; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DrivingLicenceDetailsSplitAddress drivingLicenceDetailsSplitAddress = (DrivingLicenceDetailsSplitAddress) o; + return Objects.equals(this.district, drivingLicenceDetailsSplitAddress.district) && + Objects.equals(this.state, drivingLicenceDetailsSplitAddress.state) && + Objects.equals(this.city, drivingLicenceDetailsSplitAddress.city) && + Objects.equals(this.pincode, drivingLicenceDetailsSplitAddress.pincode) && + Objects.equals(this.country, drivingLicenceDetailsSplitAddress.country) && + Objects.equals(this.addressLine, drivingLicenceDetailsSplitAddress.addressLine); + } + + @Override + public int hashCode() { + return Objects.hash(district, state, city, pincode, country, addressLine); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DrivingLicenceDetailsSplitAddress {\n"); + sb.append(" district: ").append(toIndentedString(district)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" addressLine: ").append(toIndentedString(addressLine)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("district"); + openapiFields.add("state"); + openapiFields.add("city"); + openapiFields.add("pincode"); + openapiFields.add("country"); + openapiFields.add("address_line"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DrivingLicenceDetailsSplitAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + } + + + /** + * 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 DrivingLicenceDetailsSplitAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrivingLicenceDetailsSplitAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrivingLicenceDetailsSplitAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrivingLicenceDetailsSplitAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrivingLicenceDetailsSplitAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrivingLicenceDetailsSplitAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrivingLicenceDetailsSplitAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrivingLicenceDetailsSplitAddress + * @throws IOException if the JSON string is invalid with respect to DrivingLicenceDetailsSplitAddress + */ + public static DrivingLicenceDetailsSplitAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrivingLicenceDetailsSplitAddress.class); + } + + /** + * Convert an instance of DrivingLicenceDetailsSplitAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DrivingLicenseRequestSchema.java b/src/main/java/com/cashfree/model/DrivingLicenseRequestSchema.java new file mode 100644 index 0000000..95c1b27 --- /dev/null +++ b/src/main/java/com/cashfree/model/DrivingLicenseRequestSchema.java @@ -0,0 +1,303 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to retrieve driving licence information + */ +@Schema(description = "Find the request parameters to retrieve driving licence information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DrivingLicenseRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "test001"; + + public static final String SERIALIZED_NAME_DL_NUMBER = "dl_number"; + @SerializedName(SERIALIZED_NAME_DL_NUMBER) + private String dlNumber = "KA5120190909083"; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob = "1993-09-23"; + + public DrivingLicenseRequestSchema() { + } + + public DrivingLicenseRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. A maximum of 50 characters are allowed. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "test001", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. A maximum of 50 characters are allowed. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public DrivingLicenseRequestSchema dlNumber(String dlNumber) { + + this.dlNumber = dlNumber; + return this; + } + + /** + * It is the driving licence number of the individual for verification. + * @return dlNumber + **/ + @javax.annotation.Nonnull + @Schema(example = "KA5120190909083", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the driving licence number of the individual for verification.") + public String getDlNumber() { + return dlNumber; + } + + + public void setDlNumber(String dlNumber) { + this.dlNumber = dlNumber; + } + + + public DrivingLicenseRequestSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It is the date of birth of the individual as present in the driving licence. The accepted format is YYYY-MM-DD. + * @return dob + **/ + @javax.annotation.Nonnull + @Schema(example = "1993-09-23", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the date of birth of the individual as present in the driving licence. The accepted format is YYYY-MM-DD.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DrivingLicenseRequestSchema drivingLicenseRequestSchema = (DrivingLicenseRequestSchema) o; + return Objects.equals(this.verificationId, drivingLicenseRequestSchema.verificationId) && + Objects.equals(this.dlNumber, drivingLicenseRequestSchema.dlNumber) && + Objects.equals(this.dob, drivingLicenseRequestSchema.dob); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, dlNumber, dob); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DrivingLicenseRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" dlNumber: ").append(toIndentedString(dlNumber)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("dl_number"); + openapiFields.add("dob"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("dl_number"); + openapiRequiredFields.add("dob"); + } + + /** + * 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 DrivingLicenseRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DrivingLicenseRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("dl_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dl_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dl_number").toString())); + } + if (!jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + } + + + /** + * 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 DrivingLicenseRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DrivingLicenseRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("dl_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dl_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dl_number").toString())); + } + if (!jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrivingLicenseRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrivingLicenseRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrivingLicenseRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrivingLicenseRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrivingLicenseRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrivingLicenseRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrivingLicenseRequestSchema + * @throws IOException if the JSON string is invalid with respect to DrivingLicenseRequestSchema + */ + public static DrivingLicenseRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrivingLicenseRequestSchema.class); + } + + /** + * Convert an instance of DrivingLicenseRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DrivingLicenseResponseSchema.java b/src/main/java/com/cashfree/model/DrivingLicenseResponseSchema.java new file mode 100644 index 0000000..bd3c597 --- /dev/null +++ b/src/main/java/com/cashfree/model/DrivingLicenseResponseSchema.java @@ -0,0 +1,496 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.BadgeDetails; +import com.cashfree.model.DrivingLicenceDetails; +import com.cashfree.model.DrivingLicenseResponseSchemaDlValidity; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for retrieving driving licence information + */ +@Schema(description = "Success response for retrieving driving licence information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DrivingLicenseResponseSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_DL_NUMBER = "dl_number"; + @SerializedName(SERIALIZED_NAME_DL_NUMBER) + private String dlNumber; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_BADGE_DETAILS = "badge_details"; + @SerializedName(SERIALIZED_NAME_BADGE_DETAILS) + private List badgeDetails; + + public static final String SERIALIZED_NAME_DL_VALIDITY = "dl_validity"; + @SerializedName(SERIALIZED_NAME_DL_VALIDITY) + private DrivingLicenseResponseSchemaDlValidity dlValidity; + + public static final String SERIALIZED_NAME_DETAILS_OF_DRIVING_LICENCE = "details_of_driving_licence"; + @SerializedName(SERIALIZED_NAME_DETAILS_OF_DRIVING_LICENCE) + private DrivingLicenceDetails detailsOfDrivingLicence; + + public DrivingLicenseResponseSchema() { + } + + public DrivingLicenseResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify this API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "test001", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify this API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public DrivingLicenseResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "78", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public DrivingLicenseResponseSchema dlNumber(String dlNumber) { + + this.dlNumber = dlNumber; + return this; + } + + /** + * It displays the unique number assigned to the driving licence. + * @return dlNumber + **/ + @javax.annotation.Nullable + @Schema(example = "JK01FG8087", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique number assigned to the driving licence.") + public String getDlNumber() { + return dlNumber; + } + + + public void setDlNumber(String dlNumber) { + this.dlNumber = dlNumber; + } + + + public DrivingLicenseResponseSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the individual as present in the driving licence. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "2001-10-23", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the individual as present in the driving licence.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public DrivingLicenseResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays whether the driving licence is valid. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the driving licence is valid.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public DrivingLicenseResponseSchema badgeDetails(List badgeDetails) { + + this.badgeDetails = badgeDetails; + return this; + } + + public DrivingLicenseResponseSchema addBadgeDetailsItem(BadgeDetails badgeDetailsItem) { + if (this.badgeDetails == null) { + this.badgeDetails = new ArrayList<>(); + } + this.badgeDetails.add(badgeDetailsItem); + return this; + } + + /** + * It contains the... + * @return badgeDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It contains the...") + public List getBadgeDetails() { + return badgeDetails; + } + + + public void setBadgeDetails(List badgeDetails) { + this.badgeDetails = badgeDetails; + } + + + public DrivingLicenseResponseSchema dlValidity(DrivingLicenseResponseSchemaDlValidity dlValidity) { + + this.dlValidity = dlValidity; + return this; + } + + /** + * Get dlValidity + * @return dlValidity + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public DrivingLicenseResponseSchemaDlValidity getDlValidity() { + return dlValidity; + } + + + public void setDlValidity(DrivingLicenseResponseSchemaDlValidity dlValidity) { + this.dlValidity = dlValidity; + } + + + public DrivingLicenseResponseSchema detailsOfDrivingLicence(DrivingLicenceDetails detailsOfDrivingLicence) { + + this.detailsOfDrivingLicence = detailsOfDrivingLicence; + return this; + } + + /** + * Get detailsOfDrivingLicence + * @return detailsOfDrivingLicence + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public DrivingLicenceDetails getDetailsOfDrivingLicence() { + return detailsOfDrivingLicence; + } + + + public void setDetailsOfDrivingLicence(DrivingLicenceDetails detailsOfDrivingLicence) { + this.detailsOfDrivingLicence = detailsOfDrivingLicence; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DrivingLicenseResponseSchema drivingLicenseResponseSchema = (DrivingLicenseResponseSchema) o; + return Objects.equals(this.verificationId, drivingLicenseResponseSchema.verificationId) && + Objects.equals(this.referenceId, drivingLicenseResponseSchema.referenceId) && + Objects.equals(this.dlNumber, drivingLicenseResponseSchema.dlNumber) && + Objects.equals(this.dob, drivingLicenseResponseSchema.dob) && + Objects.equals(this.status, drivingLicenseResponseSchema.status) && + Objects.equals(this.badgeDetails, drivingLicenseResponseSchema.badgeDetails) && + Objects.equals(this.dlValidity, drivingLicenseResponseSchema.dlValidity) && + Objects.equals(this.detailsOfDrivingLicence, drivingLicenseResponseSchema.detailsOfDrivingLicence); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, referenceId, dlNumber, dob, status, badgeDetails, dlValidity, detailsOfDrivingLicence); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DrivingLicenseResponseSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" dlNumber: ").append(toIndentedString(dlNumber)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" badgeDetails: ").append(toIndentedString(badgeDetails)).append("\n"); + sb.append(" dlValidity: ").append(toIndentedString(dlValidity)).append("\n"); + sb.append(" detailsOfDrivingLicence: ").append(toIndentedString(detailsOfDrivingLicence)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("dl_number"); + openapiFields.add("dob"); + openapiFields.add("status"); + openapiFields.add("badge_details"); + openapiFields.add("dl_validity"); + openapiFields.add("details_of_driving_licence"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DrivingLicenseResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("dl_number") != null && !jsonObj.get("dl_number").isJsonNull()) && !jsonObj.get("dl_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dl_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dl_number").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if (jsonObj.get("badge_details") != null && !jsonObj.get("badge_details").isJsonNull()) { + JsonArray jsonArraybadgeDetails = jsonObj.getAsJsonArray("badge_details"); + if (jsonArraybadgeDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("badge_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `badge_details` to be an array in the JSON string but got `%s`", jsonObj.get("badge_details").toString())); + } + + // validate the optional field `badge_details` (array) + for (int i = 0; i < jsonArraybadgeDetails.size(); i++) { + BadgeDetails.validateJsonElement(jsonArraybadgeDetails.get(i)); + }; + } + } + // validate the optional field `dl_validity` + if (jsonObj.get("dl_validity") != null && !jsonObj.get("dl_validity").isJsonNull()) { + DrivingLicenseResponseSchemaDlValidity.validateJsonElement(jsonObj.get("dl_validity")); + } + // validate the optional field `details_of_driving_licence` + if (jsonObj.get("details_of_driving_licence") != null && !jsonObj.get("details_of_driving_licence").isJsonNull()) { + DrivingLicenceDetails.validateJsonElement(jsonObj.get("details_of_driving_licence")); + } + } + + + /** + * 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 DrivingLicenseResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("dl_number") != null && !jsonObj.get("dl_number").isJsonNull()) && !jsonObj.get("dl_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dl_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dl_number").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if (jsonObj.get("badge_details") != null && !jsonObj.get("badge_details").isJsonNull()) { + JsonArray jsonArraybadgeDetails = jsonObj.getAsJsonArray("badge_details"); + if (jsonArraybadgeDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("badge_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `badge_details` to be an array in the JSON string but got `%s`", jsonObj.get("badge_details").toString())); + } + + // validate the optional field `badge_details` (array) + for (int i = 0; i < jsonArraybadgeDetails.size(); i++) { + BadgeDetails.validateJsonElement(jsonArraybadgeDetails.get(i)); + }; + } + } + // validate the optional field `dl_validity` + if (jsonObj.get("dl_validity") != null && !jsonObj.get("dl_validity").isJsonNull()) { + DrivingLicenseResponseSchemaDlValidity.validateJsonElement(jsonObj.get("dl_validity")); + return true; + } + // validate the optional field `details_of_driving_licence` + if (jsonObj.get("details_of_driving_licence") != null && !jsonObj.get("details_of_driving_licence").isJsonNull()) { + DrivingLicenceDetails.validateJsonElement(jsonObj.get("details_of_driving_licence")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrivingLicenseResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrivingLicenseResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrivingLicenseResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrivingLicenseResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrivingLicenseResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrivingLicenseResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrivingLicenseResponseSchema + * @throws IOException if the JSON string is invalid with respect to DrivingLicenseResponseSchema + */ + public static DrivingLicenseResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrivingLicenseResponseSchema.class); + } + + /** + * Convert an instance of DrivingLicenseResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DrivingLicenseResponseSchemaDlValidity.java b/src/main/java/com/cashfree/model/DrivingLicenseResponseSchemaDlValidity.java new file mode 100644 index 0000000..debda1d --- /dev/null +++ b/src/main/java/com/cashfree/model/DrivingLicenseResponseSchemaDlValidity.java @@ -0,0 +1,317 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.ValidityDetails; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.time.LocalDate; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the different information regarding the validity of the licence. + */ +@Schema(description = "It contains the different information regarding the validity of the licence.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DrivingLicenseResponseSchemaDlValidity { + public static final String SERIALIZED_NAME_NON_TRANSPORT = "non_transport"; + @SerializedName(SERIALIZED_NAME_NON_TRANSPORT) + private ValidityDetails nonTransport; + + public static final String SERIALIZED_NAME_HAZARDOUS_VALID_TILL = "hazardous_valid_till"; + @SerializedName(SERIALIZED_NAME_HAZARDOUS_VALID_TILL) + private LocalDate hazardousValidTill; + + public static final String SERIALIZED_NAME_TRANSPORT = "transport"; + @SerializedName(SERIALIZED_NAME_TRANSPORT) + private ValidityDetails transport; + + public static final String SERIALIZED_NAME_HILL_VALID_TILL = "hill_valid_till"; + @SerializedName(SERIALIZED_NAME_HILL_VALID_TILL) + private LocalDate hillValidTill; + + public DrivingLicenseResponseSchemaDlValidity() { + } + + public DrivingLicenseResponseSchemaDlValidity nonTransport(ValidityDetails nonTransport) { + + this.nonTransport = nonTransport; + return this; + } + + /** + * Get nonTransport + * @return nonTransport + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public ValidityDetails getNonTransport() { + return nonTransport; + } + + + public void setNonTransport(ValidityDetails nonTransport) { + this.nonTransport = nonTransport; + } + + + public DrivingLicenseResponseSchemaDlValidity hazardousValidTill(LocalDate hazardousValidTill) { + + this.hazardousValidTill = hazardousValidTill; + return this; + } + + /** + * It displays till when the individual can drive hazardous vehicle. + * @return hazardousValidTill + **/ + @javax.annotation.Nullable + @Schema(example = "Tue Oct 23 00:00:00 UTC 2001", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays till when the individual can drive hazardous vehicle.") + public LocalDate getHazardousValidTill() { + return hazardousValidTill; + } + + + public void setHazardousValidTill(LocalDate hazardousValidTill) { + this.hazardousValidTill = hazardousValidTill; + } + + + public DrivingLicenseResponseSchemaDlValidity transport(ValidityDetails transport) { + + this.transport = transport; + return this; + } + + /** + * Get transport + * @return transport + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public ValidityDetails getTransport() { + return transport; + } + + + public void setTransport(ValidityDetails transport) { + this.transport = transport; + } + + + public DrivingLicenseResponseSchemaDlValidity hillValidTill(LocalDate hillValidTill) { + + this.hillValidTill = hillValidTill; + return this; + } + + /** + * It displays till when the individual can drive the vehicle in hill and mountain regions. + * @return hillValidTill + **/ + @javax.annotation.Nullable + @Schema(example = "Tue Oct 23 00:00:00 UTC 2001", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays till when the individual can drive the vehicle in hill and mountain regions.") + public LocalDate getHillValidTill() { + return hillValidTill; + } + + + public void setHillValidTill(LocalDate hillValidTill) { + this.hillValidTill = hillValidTill; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DrivingLicenseResponseSchemaDlValidity drivingLicenseResponseSchemaDlValidity = (DrivingLicenseResponseSchemaDlValidity) o; + return Objects.equals(this.nonTransport, drivingLicenseResponseSchemaDlValidity.nonTransport) && + Objects.equals(this.hazardousValidTill, drivingLicenseResponseSchemaDlValidity.hazardousValidTill) && + Objects.equals(this.transport, drivingLicenseResponseSchemaDlValidity.transport) && + Objects.equals(this.hillValidTill, drivingLicenseResponseSchemaDlValidity.hillValidTill); + } + + @Override + public int hashCode() { + return Objects.hash(nonTransport, hazardousValidTill, transport, hillValidTill); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DrivingLicenseResponseSchemaDlValidity {\n"); + sb.append(" nonTransport: ").append(toIndentedString(nonTransport)).append("\n"); + sb.append(" hazardousValidTill: ").append(toIndentedString(hazardousValidTill)).append("\n"); + sb.append(" transport: ").append(toIndentedString(transport)).append("\n"); + sb.append(" hillValidTill: ").append(toIndentedString(hillValidTill)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("non_transport"); + openapiFields.add("hazardous_valid_till"); + openapiFields.add("transport"); + openapiFields.add("hill_valid_till"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DrivingLicenseResponseSchemaDlValidity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `non_transport` + if (jsonObj.get("non_transport") != null && !jsonObj.get("non_transport").isJsonNull()) { + ValidityDetails.validateJsonElement(jsonObj.get("non_transport")); + } + // validate the optional field `transport` + if (jsonObj.get("transport") != null && !jsonObj.get("transport").isJsonNull()) { + ValidityDetails.validateJsonElement(jsonObj.get("transport")); + } + } + + + /** + * 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 DrivingLicenseResponseSchemaDlValidity + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `non_transport` + if (jsonObj.get("non_transport") != null && !jsonObj.get("non_transport").isJsonNull()) { + ValidityDetails.validateJsonElement(jsonObj.get("non_transport")); + return true; + } + // validate the optional field `transport` + if (jsonObj.get("transport") != null && !jsonObj.get("transport").isJsonNull()) { + ValidityDetails.validateJsonElement(jsonObj.get("transport")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DrivingLicenseResponseSchemaDlValidity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DrivingLicenseResponseSchemaDlValidity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DrivingLicenseResponseSchemaDlValidity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DrivingLicenseResponseSchemaDlValidity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DrivingLicenseResponseSchemaDlValidity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DrivingLicenseResponseSchemaDlValidity given an JSON string + * + * @param jsonString JSON string + * @return An instance of DrivingLicenseResponseSchemaDlValidity + * @throws IOException if the JSON string is invalid with respect to DrivingLicenseResponseSchemaDlValidity + */ + public static DrivingLicenseResponseSchemaDlValidity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DrivingLicenseResponseSchemaDlValidity.class); + } + + /** + * Convert an instance of DrivingLicenseResponseSchemaDlValidity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/DuplicateVerificationId.java b/src/main/java/com/cashfree/model/DuplicateVerificationId.java new file mode 100644 index 0000000..5f775c3 --- /dev/null +++ b/src/main/java/com/cashfree/model/DuplicateVerificationId.java @@ -0,0 +1,286 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * 400 response for duplicate verification_id + */ +@Schema(description = "400 response for duplicate verification_id") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class DuplicateVerificationId { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public DuplicateVerificationId() { + } + + public DuplicateVerificationId type(String type) { + + this.type = type; + return this; + } + + /** + * It displays the type of error. + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "validation_error", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of error.") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public DuplicateVerificationId code(String code) { + + this.code = code; + return this; + } + + /** + * It displays the outcome or status of the API request. + * @return code + **/ + @javax.annotation.Nullable + @Schema(example = "duplicate_verification_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the outcome or status of the API request.") + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public DuplicateVerificationId message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "verification_id already exists", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DuplicateVerificationId duplicateVerificationId = (DuplicateVerificationId) o; + return Objects.equals(this.type, duplicateVerificationId.type) && + Objects.equals(this.code, duplicateVerificationId.code) && + Objects.equals(this.message, duplicateVerificationId.message); + } + + @Override + public int hashCode() { + return Objects.hash(type, code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DuplicateVerificationId {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("code"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 DuplicateVerificationId + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 DuplicateVerificationId + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DuplicateVerificationId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DuplicateVerificationId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DuplicateVerificationId.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DuplicateVerificationId value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DuplicateVerificationId read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DuplicateVerificationId given an JSON string + * + * @param jsonString JSON string + * @return An instance of DuplicateVerificationId + * @throws IOException if the JSON string is invalid with respect to DuplicateVerificationId + */ + public static DuplicateVerificationId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DuplicateVerificationId.class); + } + + /** + * Convert an instance of DuplicateVerificationId to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchema.java b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchema.java new file mode 100644 index 0000000..4d41d2e --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchema.java @@ -0,0 +1,573 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.ESignVerificationCreateSignatureRequestSchemaSignersInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to add the details of the document and signer(s) + */ +@Schema(description = "Find the request parameters to add the details of the document and signer(s)") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationCreateSignatureRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "ABC00123"; + + public static final String SERIALIZED_NAME_DOCUMENT_ID = "document_id"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_ID) + private Integer documentId = 36; + + /** + * Gets or Sets notificationModes + */ + @JsonAdapter(NotificationModesEnum.Adapter.class) + public enum NotificationModesEnum { + EMAIL("email"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + NotificationModesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NotificationModesEnum fromValue(String value) { + for (NotificationModesEnum b : NotificationModesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NotificationModesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NotificationModesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NotificationModesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_NOTIFICATION_MODES = "notification_modes"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_MODES) + private List notificationModes = new ArrayList<>(); + + /** + * It is the type of authentication to be used for signature. + */ + @JsonAdapter(AuthTypeEnum.Adapter.class) + public enum AuthTypeEnum { + AADHAAR("AADHAAR"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + AuthTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthTypeEnum fromValue(String value) { + for (AuthTypeEnum b : AuthTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUTH_TYPE = "auth_type"; + @SerializedName(SERIALIZED_NAME_AUTH_TYPE) + private AuthTypeEnum authType; + + public static final String SERIALIZED_NAME_EXPIRY_IN_DAYS = "expiry_in_days"; + @SerializedName(SERIALIZED_NAME_EXPIRY_IN_DAYS) + private String expiryInDays = "2"; + + public static final String SERIALIZED_NAME_SIGNERS = "signers"; + @SerializedName(SERIALIZED_NAME_SIGNERS) + private List signers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REDIRECT_URL = "redirect_url"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URL) + private String redirectUrl = "REDIRECT_PAGE_URL"; + + public ESignVerificationCreateSignatureRequestSchema() { + } + + public ESignVerificationCreateSignatureRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public ESignVerificationCreateSignatureRequestSchema documentId(Integer documentId) { + + this.documentId = documentId; + return this; + } + + /** + * It is the unique ID received in the Upload Document for E-Sign API response. + * @return documentId + **/ + @javax.annotation.Nonnull + @Schema(example = "36", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID received in the Upload Document for E-Sign API response.") + public Integer getDocumentId() { + return documentId; + } + + + public void setDocumentId(Integer documentId) { + this.documentId = documentId; + } + + + public ESignVerificationCreateSignatureRequestSchema notificationModes(List notificationModes) { + + this.notificationModes = notificationModes; + return this; + } + + public ESignVerificationCreateSignatureRequestSchema addNotificationModesItem(NotificationModesEnum notificationModesItem) { + if (this.notificationModes == null) { + this.notificationModes = new ArrayList<>(); + } + this.notificationModes.add(notificationModesItem); + return this; + } + + /** + * It is how you want to notify the signee about the e-sign details. + * @return notificationModes + **/ + @javax.annotation.Nonnull + @Schema(example = "[\"email\"]", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is how you want to notify the signee about the e-sign details.") + public List getNotificationModes() { + return notificationModes; + } + + + public void setNotificationModes(List notificationModes) { + this.notificationModes = notificationModes; + } + + + public ESignVerificationCreateSignatureRequestSchema authType(AuthTypeEnum authType) { + + this.authType = authType; + return this; + } + + /** + * It is the type of authentication to be used for signature. + * @return authType + **/ + @javax.annotation.Nonnull + @Schema(example = "AADHAAR", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the type of authentication to be used for signature.") + public AuthTypeEnum getAuthType() { + return authType; + } + + + public void setAuthType(AuthTypeEnum authType) { + this.authType = authType; + } + + + public ESignVerificationCreateSignatureRequestSchema expiryInDays(String expiryInDays) { + + this.expiryInDays = expiryInDays; + return this; + } + + /** + * It is the expiry of the signing link for each signer in days. The maximum allowed time is 15 days. + * @return expiryInDays + **/ + @javax.annotation.Nonnull + @Schema(example = "2", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the expiry of the signing link for each signer in days. The maximum allowed time is 15 days.") + public String getExpiryInDays() { + return expiryInDays; + } + + + public void setExpiryInDays(String expiryInDays) { + this.expiryInDays = expiryInDays; + } + + + public ESignVerificationCreateSignatureRequestSchema signers(List signers) { + + this.signers = signers; + return this; + } + + public ESignVerificationCreateSignatureRequestSchema addSignersItem(ESignVerificationCreateSignatureRequestSchemaSignersInner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * It should contain the details of the signer(s). + * @return signers + **/ + @javax.annotation.Nonnull + @Schema(example = "[{\"name\":\"John Doe\",\"email\":\"John.Doe@email.com\",\"phone\":\"9999999999\",\"sequence\":1,\"sign_positions\":[{\"page\":1,\"top_left_x_coordinate\":100,\"bottom_right_x_coordinate\":200,\"top_left_y_coordinate\":180,\"bottom_right_y_coordinate\":120},{\"page\":2,\"top_left_x_coordinate\":100,\"bottom_right_x_coordinate\":200,\"top_left_y_coordinate\":180,\"bottom_right_y_coordinate\":120}]}]", requiredMode = Schema.RequiredMode.REQUIRED, description = "It should contain the details of the signer(s).") + public List getSigners() { + return signers; + } + + + public void setSigners(List signers) { + this.signers = signers; + } + + + public ESignVerificationCreateSignatureRequestSchema redirectUrl(String redirectUrl) { + + this.redirectUrl = redirectUrl; + return this; + } + + /** + * It is the URL that you need to provide that takes the user to after completing the e-sign journey. It will contain the verification_id that can be used to get the status of the verification. + * @return redirectUrl + **/ + @javax.annotation.Nullable + @Schema(example = "REDIRECT_PAGE_URL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the URL that you need to provide that takes the user to after completing the e-sign journey. It will contain the verification_id that can be used to get the status of the verification.") + public String getRedirectUrl() { + return redirectUrl; + } + + + public void setRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationCreateSignatureRequestSchema esignVerificationCreateSignatureRequestSchema = (ESignVerificationCreateSignatureRequestSchema) o; + return Objects.equals(this.verificationId, esignVerificationCreateSignatureRequestSchema.verificationId) && + Objects.equals(this.documentId, esignVerificationCreateSignatureRequestSchema.documentId) && + Objects.equals(this.notificationModes, esignVerificationCreateSignatureRequestSchema.notificationModes) && + Objects.equals(this.authType, esignVerificationCreateSignatureRequestSchema.authType) && + Objects.equals(this.expiryInDays, esignVerificationCreateSignatureRequestSchema.expiryInDays) && + Objects.equals(this.signers, esignVerificationCreateSignatureRequestSchema.signers) && + Objects.equals(this.redirectUrl, esignVerificationCreateSignatureRequestSchema.redirectUrl); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, documentId, notificationModes, authType, expiryInDays, signers, redirectUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationCreateSignatureRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" documentId: ").append(toIndentedString(documentId)).append("\n"); + sb.append(" notificationModes: ").append(toIndentedString(notificationModes)).append("\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" expiryInDays: ").append(toIndentedString(expiryInDays)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("document_id"); + openapiFields.add("notification_modes"); + openapiFields.add("auth_type"); + openapiFields.add("expiry_in_days"); + openapiFields.add("signers"); + openapiFields.add("redirect_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("document_id"); + openapiRequiredFields.add("notification_modes"); + openapiRequiredFields.add("auth_type"); + openapiRequiredFields.add("expiry_in_days"); + openapiRequiredFields.add("signers"); + } + + /** + * 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 ESignVerificationCreateSignatureRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationCreateSignatureRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + // ensure the required json array is present + if (jsonObj.get("notification_modes") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("notification_modes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_modes` to be an array in the JSON string but got `%s`", jsonObj.get("notification_modes").toString())); + } + if (!jsonObj.get("auth_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `auth_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auth_type").toString())); + } + if (!jsonObj.get("expiry_in_days").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expiry_in_days` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiry_in_days").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("signers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signers` to be an array in the JSON string but got `%s`", jsonObj.get("signers").toString())); + } + + JsonArray jsonArraysigners = jsonObj.getAsJsonArray("signers"); + // validate the required field `signers` (array) + for (int i = 0; i < jsonArraysigners.size(); i++) { + ESignVerificationCreateSignatureRequestSchemaSignersInner.validateJsonElement(jsonArraysigners.get(i)); + }; + if ((jsonObj.get("redirect_url") != null && !jsonObj.get("redirect_url").isJsonNull()) && !jsonObj.get("redirect_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_url").toString())); + } + } + + + /** + * 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 ESignVerificationCreateSignatureRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationCreateSignatureRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + // ensure the required json array is present + if (jsonObj.get("notification_modes") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("notification_modes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_modes` to be an array in the JSON string but got `%s`", jsonObj.get("notification_modes").toString())); + } + if (!jsonObj.get("auth_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `auth_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auth_type").toString())); + } + if (!jsonObj.get("expiry_in_days").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expiry_in_days` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiry_in_days").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("signers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signers` to be an array in the JSON string but got `%s`", jsonObj.get("signers").toString())); + } + + JsonArray jsonArraysigners = jsonObj.getAsJsonArray("signers"); + // validate the required field `signers` (array) + for (int i = 0; i < jsonArraysigners.size(); i++) { + ESignVerificationCreateSignatureRequestSchemaSignersInner.validateJsonElement(jsonArraysigners.get(i)); + }; + if ((jsonObj.get("redirect_url") != null && !jsonObj.get("redirect_url").isJsonNull()) && !jsonObj.get("redirect_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_url").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationCreateSignatureRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationCreateSignatureRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationCreateSignatureRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationCreateSignatureRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationCreateSignatureRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationCreateSignatureRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationCreateSignatureRequestSchema + * @throws IOException if the JSON string is invalid with respect to ESignVerificationCreateSignatureRequestSchema + */ + public static ESignVerificationCreateSignatureRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationCreateSignatureRequestSchema.class); + } + + /** + * Convert an instance of ESignVerificationCreateSignatureRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInner.java b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInner.java new file mode 100644 index 0000000..119bdb8 --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInner.java @@ -0,0 +1,392 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * ESignVerificationCreateSignatureRequestSchemaSignersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationCreateSignatureRequestSchemaSignersInner { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "John Doe"; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email = "abc.def@klm.com"; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone = "9999999999"; + + public static final String SERIALIZED_NAME_SEQUENCE = "sequence"; + @SerializedName(SERIALIZED_NAME_SEQUENCE) + private Integer sequence = 1; + + public static final String SERIALIZED_NAME_SIGN_POSITIONS = "sign_positions"; + @SerializedName(SERIALIZED_NAME_SIGN_POSITIONS) + private List signPositions = new ArrayList<>(); + + public ESignVerificationCreateSignatureRequestSchemaSignersInner() { + } + + public ESignVerificationCreateSignatureRequestSchemaSignersInner name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the signer. + * @return name + **/ + @javax.annotation.Nonnull + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the name of the signer.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInner email(String email) { + + this.email = email; + return this; + } + + /** + * It is the email ID of the signer. + * @return email + **/ + @javax.annotation.Nonnull + @Schema(example = "abc.def@klm.com", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the email ID of the signer.") + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInner phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * It is the phone number of the signer. + * @return phone + **/ + @javax.annotation.Nullable + @Schema(example = "9999999999", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the phone number of the signer.") + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInner sequence(Integer sequence) { + + this.sequence = sequence; + return this; + } + + /** + * It displays the sequence of the signer to sign the document. The value can be between 1 to n where n is number of signers. + * @return sequence + **/ + @javax.annotation.Nonnull + @Schema(example = "1", requiredMode = Schema.RequiredMode.REQUIRED, description = "It displays the sequence of the signer to sign the document. The value can be between 1 to n where n is number of signers.") + public Integer getSequence() { + return sequence; + } + + + public void setSequence(Integer sequence) { + this.sequence = sequence; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInner signPositions(List signPositions) { + + this.signPositions = signPositions; + return this; + } + + public ESignVerificationCreateSignatureRequestSchemaSignersInner addSignPositionsItem(ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner signPositionsItem) { + if (this.signPositions == null) { + this.signPositions = new ArrayList<>(); + } + this.signPositions.add(signPositionsItem); + return this; + } + + /** + * It displays the page wise coordinates of the rectangular space for signature placement. + * @return signPositions + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "It displays the page wise coordinates of the rectangular space for signature placement.") + public List getSignPositions() { + return signPositions; + } + + + public void setSignPositions(List signPositions) { + this.signPositions = signPositions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationCreateSignatureRequestSchemaSignersInner esignVerificationCreateSignatureRequestSchemaSignersInner = (ESignVerificationCreateSignatureRequestSchemaSignersInner) o; + return Objects.equals(this.name, esignVerificationCreateSignatureRequestSchemaSignersInner.name) && + Objects.equals(this.email, esignVerificationCreateSignatureRequestSchemaSignersInner.email) && + Objects.equals(this.phone, esignVerificationCreateSignatureRequestSchemaSignersInner.phone) && + Objects.equals(this.sequence, esignVerificationCreateSignatureRequestSchemaSignersInner.sequence) && + Objects.equals(this.signPositions, esignVerificationCreateSignatureRequestSchemaSignersInner.signPositions); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, phone, sequence, signPositions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationCreateSignatureRequestSchemaSignersInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" sequence: ").append(toIndentedString(sequence)).append("\n"); + sb.append(" signPositions: ").append(toIndentedString(signPositions)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("email"); + openapiFields.add("phone"); + openapiFields.add("sequence"); + openapiFields.add("sign_positions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("sequence"); + openapiRequiredFields.add("sign_positions"); + } + + /** + * 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 ESignVerificationCreateSignatureRequestSchemaSignersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationCreateSignatureRequestSchemaSignersInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("sign_positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sign_positions` to be an array in the JSON string but got `%s`", jsonObj.get("sign_positions").toString())); + } + + JsonArray jsonArraysignPositions = jsonObj.getAsJsonArray("sign_positions"); + // validate the required field `sign_positions` (array) + for (int i = 0; i < jsonArraysignPositions.size(); i++) { + ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.validateJsonElement(jsonArraysignPositions.get(i)); + }; + } + + + /** + * 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 ESignVerificationCreateSignatureRequestSchemaSignersInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationCreateSignatureRequestSchemaSignersInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("sign_positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sign_positions` to be an array in the JSON string but got `%s`", jsonObj.get("sign_positions").toString())); + } + + JsonArray jsonArraysignPositions = jsonObj.getAsJsonArray("sign_positions"); + // validate the required field `sign_positions` (array) + for (int i = 0; i < jsonArraysignPositions.size(); i++) { + ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.validateJsonElement(jsonArraysignPositions.get(i)); + }; + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationCreateSignatureRequestSchemaSignersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationCreateSignatureRequestSchemaSignersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationCreateSignatureRequestSchemaSignersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationCreateSignatureRequestSchemaSignersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationCreateSignatureRequestSchemaSignersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationCreateSignatureRequestSchemaSignersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationCreateSignatureRequestSchemaSignersInner + * @throws IOException if the JSON string is invalid with respect to ESignVerificationCreateSignatureRequestSchemaSignersInner + */ + public static ESignVerificationCreateSignatureRequestSchemaSignersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationCreateSignatureRequestSchemaSignersInner.class); + } + + /** + * Convert an instance of ESignVerificationCreateSignatureRequestSchemaSignersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.java b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.java new file mode 100644 index 0000000..7a779ee --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.java @@ -0,0 +1,344 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner { + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + private Integer page = 1; + + public static final String SERIALIZED_NAME_TOP_LEFT_X_COORDINATE = "top_left_x_coordinate"; + @SerializedName(SERIALIZED_NAME_TOP_LEFT_X_COORDINATE) + private Integer topLeftXCoordinate = 100; + + public static final String SERIALIZED_NAME_BOTTOM_RIGHT_X_COORDINATE = "bottom_right_x_coordinate"; + @SerializedName(SERIALIZED_NAME_BOTTOM_RIGHT_X_COORDINATE) + private Integer bottomRightXCoordinate = 200; + + public static final String SERIALIZED_NAME_TOP_LEFT_Y_COORDINATE = "top_left_y_coordinate"; + @SerializedName(SERIALIZED_NAME_TOP_LEFT_Y_COORDINATE) + private Integer topLeftYCoordinate = 180; + + public static final String SERIALIZED_NAME_BOTTOM_RIGHT_Y_COORDINATE = "bottom_right_y_coordinate"; + @SerializedName(SERIALIZED_NAME_BOTTOM_RIGHT_Y_COORDINATE) + private Integer bottomRightYCoordinate = 120; + + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner() { + } + + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner page(Integer page) { + + this.page = page; + return this; + } + + /** + * It is the page number where the signer places the signature. + * @return page + **/ + @javax.annotation.Nonnull + @Schema(example = "1", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the page number where the signer places the signature.") + public Integer getPage() { + return page; + } + + + public void setPage(Integer page) { + this.page = page; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner topLeftXCoordinate(Integer topLeftXCoordinate) { + + this.topLeftXCoordinate = topLeftXCoordinate; + return this; + } + + /** + * It is the top left X coordinate of the signature area (rectangular). + * @return topLeftXCoordinate + **/ + @javax.annotation.Nonnull + @Schema(example = "100", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the top left X coordinate of the signature area (rectangular).") + public Integer getTopLeftXCoordinate() { + return topLeftXCoordinate; + } + + + public void setTopLeftXCoordinate(Integer topLeftXCoordinate) { + this.topLeftXCoordinate = topLeftXCoordinate; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner bottomRightXCoordinate(Integer bottomRightXCoordinate) { + + this.bottomRightXCoordinate = bottomRightXCoordinate; + return this; + } + + /** + * It is the bottom right X coordinate of the signature area (rectangular). + * @return bottomRightXCoordinate + **/ + @javax.annotation.Nonnull + @Schema(example = "200", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the bottom right X coordinate of the signature area (rectangular).") + public Integer getBottomRightXCoordinate() { + return bottomRightXCoordinate; + } + + + public void setBottomRightXCoordinate(Integer bottomRightXCoordinate) { + this.bottomRightXCoordinate = bottomRightXCoordinate; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner topLeftYCoordinate(Integer topLeftYCoordinate) { + + this.topLeftYCoordinate = topLeftYCoordinate; + return this; + } + + /** + * It is the top left Y coordinate of the signature area (rectangular). + * @return topLeftYCoordinate + **/ + @javax.annotation.Nonnull + @Schema(example = "180", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the top left Y coordinate of the signature area (rectangular).") + public Integer getTopLeftYCoordinate() { + return topLeftYCoordinate; + } + + + public void setTopLeftYCoordinate(Integer topLeftYCoordinate) { + this.topLeftYCoordinate = topLeftYCoordinate; + } + + + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner bottomRightYCoordinate(Integer bottomRightYCoordinate) { + + this.bottomRightYCoordinate = bottomRightYCoordinate; + return this; + } + + /** + * It is the bottom right Y coordinate of the signature area (rectangular). + * @return bottomRightYCoordinate + **/ + @javax.annotation.Nonnull + @Schema(example = "120", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the bottom right Y coordinate of the signature area (rectangular).") + public Integer getBottomRightYCoordinate() { + return bottomRightYCoordinate; + } + + + public void setBottomRightYCoordinate(Integer bottomRightYCoordinate) { + this.bottomRightYCoordinate = bottomRightYCoordinate; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner esignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner = (ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner) o; + return Objects.equals(this.page, esignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.page) && + Objects.equals(this.topLeftXCoordinate, esignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.topLeftXCoordinate) && + Objects.equals(this.bottomRightXCoordinate, esignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.bottomRightXCoordinate) && + Objects.equals(this.topLeftYCoordinate, esignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.topLeftYCoordinate) && + Objects.equals(this.bottomRightYCoordinate, esignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.bottomRightYCoordinate); + } + + @Override + public int hashCode() { + return Objects.hash(page, topLeftXCoordinate, bottomRightXCoordinate, topLeftYCoordinate, bottomRightYCoordinate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" topLeftXCoordinate: ").append(toIndentedString(topLeftXCoordinate)).append("\n"); + sb.append(" bottomRightXCoordinate: ").append(toIndentedString(bottomRightXCoordinate)).append("\n"); + sb.append(" topLeftYCoordinate: ").append(toIndentedString(topLeftYCoordinate)).append("\n"); + sb.append(" bottomRightYCoordinate: ").append(toIndentedString(bottomRightYCoordinate)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("page"); + openapiFields.add("top_left_x_coordinate"); + openapiFields.add("bottom_right_x_coordinate"); + openapiFields.add("top_left_y_coordinate"); + openapiFields.add("bottom_right_y_coordinate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("page"); + openapiRequiredFields.add("top_left_x_coordinate"); + openapiRequiredFields.add("bottom_right_x_coordinate"); + openapiRequiredFields.add("top_left_y_coordinate"); + openapiRequiredFields.add("bottom_right_y_coordinate"); + } + + /** + * 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 ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + + /** + * 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 ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner + * @throws IOException if the JSON string is invalid with respect to ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner + */ + public static ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner.class); + } + + /** + * Convert an instance of ESignVerificationCreateSignatureRequestSchemaSignersInnerSignPositionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureResponseSchema.java b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureResponseSchema.java new file mode 100644 index 0000000..49ea37b --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationCreateSignatureResponseSchema.java @@ -0,0 +1,344 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Create E-Sign RequestR + */ +@Schema(description = "Success response for Create E-Sign RequestR") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationCreateSignatureResponseSchema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_DOCUMENT_ID = "document_id"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_ID) + private Integer documentId; + + public static final String SERIALIZED_NAME_SIGNING_LINK = "signing_link"; + @SerializedName(SERIALIZED_NAME_SIGNING_LINK) + private String signingLink; + + public ESignVerificationCreateSignatureResponseSchema() { + } + + public ESignVerificationCreateSignatureResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public ESignVerificationCreateSignatureResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public ESignVerificationCreateSignatureResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "33", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public ESignVerificationCreateSignatureResponseSchema documentId(Integer documentId) { + + this.documentId = documentId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments to identify the document. You receive this ID in the response of Upload Document For E-Sign API. + * @return documentId + **/ + @javax.annotation.Nullable + @Schema(example = "36", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments to identify the document. You receive this ID in the response of Upload Document For E-Sign API.") + public Integer getDocumentId() { + return documentId; + } + + + public void setDocumentId(Integer documentId) { + this.documentId = documentId; + } + + + public ESignVerificationCreateSignatureResponseSchema signingLink(String signingLink) { + + this.signingLink = signingLink; + return this; + } + + /** + * It displays the link to proceed with the e-signature of the document. + * @return signingLink + **/ + @javax.annotation.Nullable + @Schema(example = "SIGNING_LINK", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the link to proceed with the e-signature of the document.") + public String getSigningLink() { + return signingLink; + } + + + public void setSigningLink(String signingLink) { + this.signingLink = signingLink; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationCreateSignatureResponseSchema esignVerificationCreateSignatureResponseSchema = (ESignVerificationCreateSignatureResponseSchema) o; + return Objects.equals(this.status, esignVerificationCreateSignatureResponseSchema.status) && + Objects.equals(this.verificationId, esignVerificationCreateSignatureResponseSchema.verificationId) && + Objects.equals(this.referenceId, esignVerificationCreateSignatureResponseSchema.referenceId) && + Objects.equals(this.documentId, esignVerificationCreateSignatureResponseSchema.documentId) && + Objects.equals(this.signingLink, esignVerificationCreateSignatureResponseSchema.signingLink); + } + + @Override + public int hashCode() { + return Objects.hash(status, verificationId, referenceId, documentId, signingLink); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationCreateSignatureResponseSchema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" documentId: ").append(toIndentedString(documentId)).append("\n"); + sb.append(" signingLink: ").append(toIndentedString(signingLink)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("document_id"); + openapiFields.add("signing_link"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 ESignVerificationCreateSignatureResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("signing_link") != null && !jsonObj.get("signing_link").isJsonNull()) && !jsonObj.get("signing_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signing_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signing_link").toString())); + } + } + + + /** + * 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 ESignVerificationCreateSignatureResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("signing_link") != null && !jsonObj.get("signing_link").isJsonNull()) && !jsonObj.get("signing_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signing_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signing_link").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationCreateSignatureResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationCreateSignatureResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationCreateSignatureResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationCreateSignatureResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationCreateSignatureResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationCreateSignatureResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationCreateSignatureResponseSchema + * @throws IOException if the JSON string is invalid with respect to ESignVerificationCreateSignatureResponseSchema + */ + public static ESignVerificationCreateSignatureResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationCreateSignatureResponseSchema.class); + } + + /** + * Convert an instance of ESignVerificationCreateSignatureResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchema.java b/src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchema.java new file mode 100644 index 0000000..9fa1f8d --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchema.java @@ -0,0 +1,412 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.ESignVerificationGetStatusResponseSchemaSignersInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Get E-Sign Status + */ +@Schema(description = "Success response for Get E-Sign Status") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationGetStatusResponseSchema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_DOCUMENT_ID = "document_id"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_ID) + private Integer documentId; + + public static final String SERIALIZED_NAME_SIGNERS = "signers"; + @SerializedName(SERIALIZED_NAME_SIGNERS) + private List signers; + + public static final String SERIALIZED_NAME_SIGNED_DOC_URL = "signed_doc_url"; + @SerializedName(SERIALIZED_NAME_SIGNED_DOC_URL) + private String signedDocUrl; + + public ESignVerificationGetStatusResponseSchema() { + } + + public ESignVerificationGetStatusResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the e-signature. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "IN_PROGRESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the e-signature.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public ESignVerificationGetStatusResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "32", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public ESignVerificationGetStatusResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID created by you to identify the API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by you to identify the API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public ESignVerificationGetStatusResponseSchema documentId(Integer documentId) { + + this.documentId = documentId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments to identify the uploaded document. + * @return documentId + **/ + @javax.annotation.Nullable + @Schema(example = "36", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments to identify the uploaded document.") + public Integer getDocumentId() { + return documentId; + } + + + public void setDocumentId(Integer documentId) { + this.documentId = documentId; + } + + + public ESignVerificationGetStatusResponseSchema signers(List signers) { + + this.signers = signers; + return this; + } + + public ESignVerificationGetStatusResponseSchema addSignersItem(ESignVerificationGetStatusResponseSchemaSignersInner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * It contains the details of the signer(s). + * @return signers + **/ + @javax.annotation.Nullable + @Schema(example = "[{\"name\":\"John Doe\",\"status\":\"RECEIVED\",\"is_notified\":false},{\"name\":\"John Snow\",\"status\":\"SIGN_INITIATED\",\"is_notified\":true},{\"name\":\"Frank Kelvin\",\"status\":\"SIGN_IN_PROGRESS\",\"is_notified\":true},{\"name\":\"John Cena\",\"status\":\"SUCCESS\",\"is_notified\":true},{\"name\":\"John Frank\",\"status\":\"FAILURE\",\"is_notified\":true},{\"name\":\"Frank Doe\",\"status\":\"EXPIRED\",\"is_notified\":true}]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It contains the details of the signer(s).") + public List getSigners() { + return signers; + } + + + public void setSigners(List signers) { + this.signers = signers; + } + + + public ESignVerificationGetStatusResponseSchema signedDocUrl(String signedDocUrl) { + + this.signedDocUrl = signedDocUrl; + return this; + } + + /** + * It displays the link of the signed document. + * @return signedDocUrl + **/ + @javax.annotation.Nullable + @Schema(example = "SIGNED_DOC_URL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the link of the signed document.") + public String getSignedDocUrl() { + return signedDocUrl; + } + + + public void setSignedDocUrl(String signedDocUrl) { + this.signedDocUrl = signedDocUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationGetStatusResponseSchema esignVerificationGetStatusResponseSchema = (ESignVerificationGetStatusResponseSchema) o; + return Objects.equals(this.status, esignVerificationGetStatusResponseSchema.status) && + Objects.equals(this.referenceId, esignVerificationGetStatusResponseSchema.referenceId) && + Objects.equals(this.verificationId, esignVerificationGetStatusResponseSchema.verificationId) && + Objects.equals(this.documentId, esignVerificationGetStatusResponseSchema.documentId) && + Objects.equals(this.signers, esignVerificationGetStatusResponseSchema.signers) && + Objects.equals(this.signedDocUrl, esignVerificationGetStatusResponseSchema.signedDocUrl); + } + + @Override + public int hashCode() { + return Objects.hash(status, referenceId, verificationId, documentId, signers, signedDocUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationGetStatusResponseSchema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" documentId: ").append(toIndentedString(documentId)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signedDocUrl: ").append(toIndentedString(signedDocUrl)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("document_id"); + openapiFields.add("signers"); + openapiFields.add("signed_doc_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 ESignVerificationGetStatusResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (jsonObj.get("signers") != null && !jsonObj.get("signers").isJsonNull()) { + JsonArray jsonArraysigners = jsonObj.getAsJsonArray("signers"); + if (jsonArraysigners != null) { + // ensure the json data is an array + if (!jsonObj.get("signers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signers` to be an array in the JSON string but got `%s`", jsonObj.get("signers").toString())); + } + + // validate the optional field `signers` (array) + for (int i = 0; i < jsonArraysigners.size(); i++) { + ESignVerificationGetStatusResponseSchemaSignersInner.validateJsonElement(jsonArraysigners.get(i)); + }; + } + } + if ((jsonObj.get("signed_doc_url") != null && !jsonObj.get("signed_doc_url").isJsonNull()) && !jsonObj.get("signed_doc_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signed_doc_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signed_doc_url").toString())); + } + } + + + /** + * 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 ESignVerificationGetStatusResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (jsonObj.get("signers") != null && !jsonObj.get("signers").isJsonNull()) { + JsonArray jsonArraysigners = jsonObj.getAsJsonArray("signers"); + if (jsonArraysigners != null) { + // ensure the json data is an array + if (!jsonObj.get("signers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signers` to be an array in the JSON string but got `%s`", jsonObj.get("signers").toString())); + } + + // validate the optional field `signers` (array) + for (int i = 0; i < jsonArraysigners.size(); i++) { + ESignVerificationGetStatusResponseSchemaSignersInner.validateJsonElement(jsonArraysigners.get(i)); + }; + } + } + if ((jsonObj.get("signed_doc_url") != null && !jsonObj.get("signed_doc_url").isJsonNull()) && !jsonObj.get("signed_doc_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signed_doc_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signed_doc_url").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationGetStatusResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationGetStatusResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationGetStatusResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationGetStatusResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationGetStatusResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationGetStatusResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationGetStatusResponseSchema + * @throws IOException if the JSON string is invalid with respect to ESignVerificationGetStatusResponseSchema + */ + public static ESignVerificationGetStatusResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationGetStatusResponseSchema.class); + } + + /** + * Convert an instance of ESignVerificationGetStatusResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchemaSignersInner.java b/src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchemaSignersInner.java new file mode 100644 index 0000000..6bc72ad --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationGetStatusResponseSchemaSignersInner.java @@ -0,0 +1,296 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * ESignVerificationGetStatusResponseSchemaSignersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationGetStatusResponseSchemaSignersInner { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_IS_NOTIFIED = "is_notified"; + @SerializedName(SERIALIZED_NAME_IS_NOTIFIED) + private Boolean isNotified; + + public ESignVerificationGetStatusResponseSchemaSignersInner() { + } + + public ESignVerificationGetStatusResponseSchemaSignersInner name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the signer. + * @return name + **/ + @javax.annotation.Nonnull + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.REQUIRED, description = "It displays the name of the signer.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ESignVerificationGetStatusResponseSchemaSignersInner status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the signature status of the signer. + * @return status + **/ + @javax.annotation.Nonnull + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.REQUIRED, description = "It displays the signature status of the signer.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public ESignVerificationGetStatusResponseSchemaSignersInner isNotified(Boolean isNotified) { + + this.isNotified = isNotified; + return this; + } + + /** + * It displays whether the signer is informed of the e-signature of the document. + * @return isNotified + **/ + @javax.annotation.Nonnull + @Schema(example = "true", requiredMode = Schema.RequiredMode.REQUIRED, description = "It displays whether the signer is informed of the e-signature of the document.") + public Boolean getIsNotified() { + return isNotified; + } + + + public void setIsNotified(Boolean isNotified) { + this.isNotified = isNotified; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationGetStatusResponseSchemaSignersInner esignVerificationGetStatusResponseSchemaSignersInner = (ESignVerificationGetStatusResponseSchemaSignersInner) o; + return Objects.equals(this.name, esignVerificationGetStatusResponseSchemaSignersInner.name) && + Objects.equals(this.status, esignVerificationGetStatusResponseSchemaSignersInner.status) && + Objects.equals(this.isNotified, esignVerificationGetStatusResponseSchemaSignersInner.isNotified); + } + + @Override + public int hashCode() { + return Objects.hash(name, status, isNotified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationGetStatusResponseSchemaSignersInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" isNotified: ").append(toIndentedString(isNotified)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("status"); + openapiFields.add("is_notified"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("is_notified"); + } + + /** + * 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 ESignVerificationGetStatusResponseSchemaSignersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationGetStatusResponseSchemaSignersInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + + /** + * 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 ESignVerificationGetStatusResponseSchemaSignersInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationGetStatusResponseSchemaSignersInner.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationGetStatusResponseSchemaSignersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationGetStatusResponseSchemaSignersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationGetStatusResponseSchemaSignersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationGetStatusResponseSchemaSignersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationGetStatusResponseSchemaSignersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationGetStatusResponseSchemaSignersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationGetStatusResponseSchemaSignersInner + * @throws IOException if the JSON string is invalid with respect to ESignVerificationGetStatusResponseSchemaSignersInner + */ + public static ESignVerificationGetStatusResponseSchemaSignersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationGetStatusResponseSchemaSignersInner.class); + } + + /** + * Convert an instance of ESignVerificationGetStatusResponseSchemaSignersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationUploadDocumentRequestSchema.java b/src/main/java/com/cashfree/model/ESignVerificationUploadDocumentRequestSchema.java new file mode 100644 index 0000000..54d79f0 --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationUploadDocumentRequestSchema.java @@ -0,0 +1,226 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to upload the document that requires an e-signature. + */ +@Schema(description = "Find the request parameters to upload the document that requires an e-signature.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationUploadDocumentRequestSchema { + public static final String SERIALIZED_NAME_DOCUMENT = "document"; + @SerializedName(SERIALIZED_NAME_DOCUMENT) + private File document; + + public ESignVerificationUploadDocumentRequestSchema() { + } + + public ESignVerificationUploadDocumentRequestSchema document(File document) { + + this.document = document; + return this; + } + + /** + * Upload the document that requires an e-sign. Allowed file type - PDF. Max file size allowed - 10MB. + * @return document + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@662d3e85", requiredMode = Schema.RequiredMode.REQUIRED, description = "Upload the document that requires an e-sign. Allowed file type - PDF. Max file size allowed - 10MB.") + public File getDocument() { + return document; + } + + + public void setDocument(File document) { + this.document = document; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationUploadDocumentRequestSchema esignVerificationUploadDocumentRequestSchema = (ESignVerificationUploadDocumentRequestSchema) o; + return Objects.equals(this.document, esignVerificationUploadDocumentRequestSchema.document); + } + + @Override + public int hashCode() { + return Objects.hash(document); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationUploadDocumentRequestSchema {\n"); + sb.append(" document: ").append(toIndentedString(document)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("document"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("document"); + } + + /** + * 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 ESignVerificationUploadDocumentRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationUploadDocumentRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + + /** + * 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 ESignVerificationUploadDocumentRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ESignVerificationUploadDocumentRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationUploadDocumentRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationUploadDocumentRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationUploadDocumentRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationUploadDocumentRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationUploadDocumentRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationUploadDocumentRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationUploadDocumentRequestSchema + * @throws IOException if the JSON string is invalid with respect to ESignVerificationUploadDocumentRequestSchema + */ + public static ESignVerificationUploadDocumentRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationUploadDocumentRequestSchema.class); + } + + /** + * Convert an instance of ESignVerificationUploadDocumentRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ESignVerificationUploadDocumentResponseSchema.java b/src/main/java/com/cashfree/model/ESignVerificationUploadDocumentResponseSchema.java new file mode 100644 index 0000000..9057f6d --- /dev/null +++ b/src/main/java/com/cashfree/model/ESignVerificationUploadDocumentResponseSchema.java @@ -0,0 +1,245 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Upload Document For E-Sign + */ +@Schema(description = "Success response for Upload Document For E-Sign") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ESignVerificationUploadDocumentResponseSchema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DOCUMENT_ID = "document_id"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_ID) + private Integer documentId; + + public ESignVerificationUploadDocumentResponseSchema() { + } + + public ESignVerificationUploadDocumentResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public ESignVerificationUploadDocumentResponseSchema documentId(Integer documentId) { + + this.documentId = documentId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments to identify the uploaded document. + * @return documentId + **/ + @javax.annotation.Nullable + @Schema(example = "14125", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments to identify the uploaded document.") + public Integer getDocumentId() { + return documentId; + } + + + public void setDocumentId(Integer documentId) { + this.documentId = documentId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ESignVerificationUploadDocumentResponseSchema esignVerificationUploadDocumentResponseSchema = (ESignVerificationUploadDocumentResponseSchema) o; + return Objects.equals(this.status, esignVerificationUploadDocumentResponseSchema.status) && + Objects.equals(this.documentId, esignVerificationUploadDocumentResponseSchema.documentId); + } + + @Override + public int hashCode() { + return Objects.hash(status, documentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ESignVerificationUploadDocumentResponseSchema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" documentId: ").append(toIndentedString(documentId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("document_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 ESignVerificationUploadDocumentResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + + /** + * 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 ESignVerificationUploadDocumentResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ESignVerificationUploadDocumentResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ESignVerificationUploadDocumentResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ESignVerificationUploadDocumentResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ESignVerificationUploadDocumentResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ESignVerificationUploadDocumentResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ESignVerificationUploadDocumentResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ESignVerificationUploadDocumentResponseSchema + * @throws IOException if the JSON string is invalid with respect to ESignVerificationUploadDocumentResponseSchema + */ + public static ESignVerificationUploadDocumentResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ESignVerificationUploadDocumentResponseSchema.class); + } + + /** + * Convert an instance of ESignVerificationUploadDocumentResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ErrorResponseSchema.java b/src/main/java/com/cashfree/model/ErrorResponseSchema.java new file mode 100644 index 0000000..cc9d398 --- /dev/null +++ b/src/main/java/com/cashfree/model/ErrorResponseSchema.java @@ -0,0 +1,315 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Response in case of error. + */ +@Schema(description = "Response in case of error.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ErrorResponseSchema { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private Object error; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public ErrorResponseSchema() { + } + + public ErrorResponseSchema code(String code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @Schema(example = "x-client-id_missing", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public ErrorResponseSchema error(Object error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + @Schema(example = "{\"ref_id\":102}", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public Object getError() { + return error; + } + + + public void setError(Object error) { + this.error = error; + } + + + public ErrorResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "x-client-id is missing in the request.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorResponseSchema type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "validation_error", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponseSchema errorResponseSchema = (ErrorResponseSchema) o; + return Objects.equals(this.code, errorResponseSchema.code) && + Objects.equals(this.error, errorResponseSchema.error) && + Objects.equals(this.message, errorResponseSchema.message) && + Objects.equals(this.type, errorResponseSchema.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, error, message, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponseSchema {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("error"); + openapiFields.add("message"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 ErrorResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + + /** + * 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 ErrorResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponseSchema + * @throws IOException if the JSON string is invalid with respect to ErrorResponseSchema + */ + public static ErrorResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponseSchema.class); + } + + /** + * Convert an instance of ErrorResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/FaceMatchRequestSchema.java b/src/main/java/com/cashfree/model/FaceMatchRequestSchema.java new file mode 100644 index 0000000..5dcb7cf --- /dev/null +++ b/src/main/java/com/cashfree/model/FaceMatchRequestSchema.java @@ -0,0 +1,414 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify facial features in two images + */ +@Schema(description = "Find the request parameters to verify facial features in two images") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class FaceMatchRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "12345678"; + + public static final String SERIALIZED_NAME_FIRST_IMAGE = "first_image"; + @SerializedName(SERIALIZED_NAME_FIRST_IMAGE) + private File firstImage; + + public static final String SERIALIZED_NAME_SECOND_IMAGE = "second_image"; + @SerializedName(SERIALIZED_NAME_SECOND_IMAGE) + private File secondImage; + + public static final String SERIALIZED_NAME_THRESHOLD = "threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + private String threshold = "0.5"; + + public static final String SERIALIZED_NAME_DETECT_MASK_FIRST_IMAGE = "detect_mask_first_image"; + @SerializedName(SERIALIZED_NAME_DETECT_MASK_FIRST_IMAGE) + private Boolean detectMaskFirstImage; + + public static final String SERIALIZED_NAME_DETECT_MASK_SECOND_IMAGE = "detect_mask_second_image"; + @SerializedName(SERIALIZED_NAME_DETECT_MASK_SECOND_IMAGE) + private Boolean detectMaskSecondImage; + + public static final String SERIALIZED_NAME_ALIGN_HORIZONTALLY = "align_horizontally"; + @SerializedName(SERIALIZED_NAME_ALIGN_HORIZONTALLY) + private Boolean alignHorizontally; + + public FaceMatchRequestSchema() { + } + + public FaceMatchRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you need to create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "12345678", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you need to create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public FaceMatchRequestSchema firstImage(File firstImage) { + + this.firstImage = firstImage; + return this; + } + + /** + * It is the scanned copy of the image 1. Allowed file type - JPEG/JPG/PNG. Maximum file size allowed for both the files is 10 MB. + * @return firstImage + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@5598dff2", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the scanned copy of the image 1. Allowed file type - JPEG/JPG/PNG. Maximum file size allowed for both the files is 10 MB.") + public File getFirstImage() { + return firstImage; + } + + + public void setFirstImage(File firstImage) { + this.firstImage = firstImage; + } + + + public FaceMatchRequestSchema secondImage(File secondImage) { + + this.secondImage = secondImage; + return this; + } + + /** + * It is the scanned copy of the image 2. Allowed file type - JPEG/JPG/PNG. Maximum file size allowed for both the files is 10 MB. + * @return secondImage + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@92b1bda", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the scanned copy of the image 2. Allowed file type - JPEG/JPG/PNG. Maximum file size allowed for both the files is 10 MB.") + public File getSecondImage() { + return secondImage; + } + + + public void setSecondImage(File secondImage) { + this.secondImage = secondImage; + } + + + public FaceMatchRequestSchema threshold(String threshold) { + + this.threshold = threshold; + return this; + } + + /** + * It is the value to distinguish and match the facial features of the two images. The range is between 0 and 1. The default value is set as 0.7. We conclude that the images match when the analysis is or greater than the value set for threshold. + * @return threshold + **/ + @javax.annotation.Nullable + @Schema(example = "0.5", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the value to distinguish and match the facial features of the two images. The range is between 0 and 1. The default value is set as 0.7. We conclude that the images match when the analysis is or greater than the value set for threshold.") + public String getThreshold() { + return threshold; + } + + + public void setThreshold(String threshold) { + this.threshold = threshold; + } + + + public FaceMatchRequestSchema detectMaskFirstImage(Boolean detectMaskFirstImage) { + + this.detectMaskFirstImage = detectMaskFirstImage; + return this; + } + + /** + * It is a boolean value to identify whether the person in the first image is wearing a mask. + * @return detectMaskFirstImage + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is a boolean value to identify whether the person in the first image is wearing a mask.") + public Boolean getDetectMaskFirstImage() { + return detectMaskFirstImage; + } + + + public void setDetectMaskFirstImage(Boolean detectMaskFirstImage) { + this.detectMaskFirstImage = detectMaskFirstImage; + } + + + public FaceMatchRequestSchema detectMaskSecondImage(Boolean detectMaskSecondImage) { + + this.detectMaskSecondImage = detectMaskSecondImage; + return this; + } + + /** + * It is a boolean value to identify whether the person in the first image is wearing a mask. + * @return detectMaskSecondImage + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is a boolean value to identify whether the person in the first image is wearing a mask.") + public Boolean getDetectMaskSecondImage() { + return detectMaskSecondImage; + } + + + public void setDetectMaskSecondImage(Boolean detectMaskSecondImage) { + this.detectMaskSecondImage = detectMaskSecondImage; + } + + + public FaceMatchRequestSchema alignHorizontally(Boolean alignHorizontally) { + + this.alignHorizontally = alignHorizontally; + return this; + } + + /** + * It is a boolean value to align the images horizontally before analysing the facial features. + * @return alignHorizontally + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is a boolean value to align the images horizontally before analysing the facial features.") + public Boolean getAlignHorizontally() { + return alignHorizontally; + } + + + public void setAlignHorizontally(Boolean alignHorizontally) { + this.alignHorizontally = alignHorizontally; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaceMatchRequestSchema faceMatchRequestSchema = (FaceMatchRequestSchema) o; + return Objects.equals(this.verificationId, faceMatchRequestSchema.verificationId) && + Objects.equals(this.firstImage, faceMatchRequestSchema.firstImage) && + Objects.equals(this.secondImage, faceMatchRequestSchema.secondImage) && + Objects.equals(this.threshold, faceMatchRequestSchema.threshold) && + Objects.equals(this.detectMaskFirstImage, faceMatchRequestSchema.detectMaskFirstImage) && + Objects.equals(this.detectMaskSecondImage, faceMatchRequestSchema.detectMaskSecondImage) && + Objects.equals(this.alignHorizontally, faceMatchRequestSchema.alignHorizontally); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, firstImage, secondImage, threshold, detectMaskFirstImage, detectMaskSecondImage, alignHorizontally); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaceMatchRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" firstImage: ").append(toIndentedString(firstImage)).append("\n"); + sb.append(" secondImage: ").append(toIndentedString(secondImage)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append(" detectMaskFirstImage: ").append(toIndentedString(detectMaskFirstImage)).append("\n"); + sb.append(" detectMaskSecondImage: ").append(toIndentedString(detectMaskSecondImage)).append("\n"); + sb.append(" alignHorizontally: ").append(toIndentedString(alignHorizontally)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("first_image"); + openapiFields.add("second_image"); + openapiFields.add("threshold"); + openapiFields.add("detect_mask_first_image"); + openapiFields.add("detect_mask_second_image"); + openapiFields.add("align_horizontally"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("first_image"); + openapiRequiredFields.add("second_image"); + } + + /** + * 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 FaceMatchRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FaceMatchRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("threshold") != null && !jsonObj.get("threshold").isJsonNull()) && !jsonObj.get("threshold").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `threshold` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threshold").toString())); + } + } + + + /** + * 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 FaceMatchRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FaceMatchRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("threshold") != null && !jsonObj.get("threshold").isJsonNull()) && !jsonObj.get("threshold").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `threshold` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threshold").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FaceMatchRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FaceMatchRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FaceMatchRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FaceMatchRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FaceMatchRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FaceMatchRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of FaceMatchRequestSchema + * @throws IOException if the JSON string is invalid with respect to FaceMatchRequestSchema + */ + public static FaceMatchRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FaceMatchRequestSchema.class); + } + + /** + * Convert an instance of FaceMatchRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/FaceMatchResponseSchema.java b/src/main/java/com/cashfree/model/FaceMatchResponseSchema.java new file mode 100644 index 0000000..474480b --- /dev/null +++ b/src/main/java/com/cashfree/model/FaceMatchResponseSchema.java @@ -0,0 +1,473 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Face Match API + */ +@Schema(description = "Success response for Face Match API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class FaceMatchResponseSchema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REF_ID = "ref_id"; + @SerializedName(SERIALIZED_NAME_REF_ID) + private Integer refId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_FACE_MATCH_RESULT = "face_match_result"; + @SerializedName(SERIALIZED_NAME_FACE_MATCH_RESULT) + private String faceMatchResult; + + public static final String SERIALIZED_NAME_FACE_MATCH_SCORE = "face_match_score"; + @SerializedName(SERIALIZED_NAME_FACE_MATCH_SCORE) + private BigDecimal faceMatchScore; + + public static final String SERIALIZED_NAME_MASK_DETECTED_FIRST_IMAGE = "maskDetected_first_image"; + @SerializedName(SERIALIZED_NAME_MASK_DETECTED_FIRST_IMAGE) + private Boolean maskDetectedFirstImage; + + public static final String SERIALIZED_NAME_MASK_DETECTED_SCORE_FIRST_IMAGE = "maskDetected_score_first_image"; + @SerializedName(SERIALIZED_NAME_MASK_DETECTED_SCORE_FIRST_IMAGE) + private String maskDetectedScoreFirstImage; + + public static final String SERIALIZED_NAME_MASK_DETECTED_SECOND_IMAGE = "maskDetected_second_image"; + @SerializedName(SERIALIZED_NAME_MASK_DETECTED_SECOND_IMAGE) + private Boolean maskDetectedSecondImage; + + public static final String SERIALIZED_NAME_MASK_DETECTED_SCORE_SECOND_IMAGE = "maskDetected_score_second_image"; + @SerializedName(SERIALIZED_NAME_MASK_DETECTED_SCORE_SECOND_IMAGE) + private String maskDetectedScoreSecondImage; + + public FaceMatchResponseSchema() { + } + + public FaceMatchResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public FaceMatchResponseSchema refId(Integer refId) { + + this.refId = refId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return refId + **/ + @javax.annotation.Nullable + @Schema(example = "2000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getRefId() { + return refId; + } + + + public void setRefId(Integer refId) { + this.refId = refId; + } + + + public FaceMatchResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "2000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public FaceMatchResponseSchema faceMatchResult(String faceMatchResult) { + + this.faceMatchResult = faceMatchResult; + return this; + } + + /** + * It displays the result of the face match verification request. + * @return faceMatchResult + **/ + @javax.annotation.Nullable + @Schema(example = "YES/NO", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the result of the face match verification request.") + public String getFaceMatchResult() { + return faceMatchResult; + } + + + public void setFaceMatchResult(String faceMatchResult) { + this.faceMatchResult = faceMatchResult; + } + + + public FaceMatchResponseSchema faceMatchScore(BigDecimal faceMatchScore) { + + this.faceMatchScore = faceMatchScore; + return this; + } + + /** + * It displays the score of the face match verification request. + * @return faceMatchScore + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score of the face match verification request.") + public BigDecimal getFaceMatchScore() { + return faceMatchScore; + } + + + public void setFaceMatchScore(BigDecimal faceMatchScore) { + this.faceMatchScore = faceMatchScore; + } + + + public FaceMatchResponseSchema maskDetectedFirstImage(Boolean maskDetectedFirstImage) { + + this.maskDetectedFirstImage = maskDetectedFirstImage; + return this; + } + + /** + * It displays whether the individual in the image 1 is wearing a mask. + * @return maskDetectedFirstImage + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the individual in the image 1 is wearing a mask.") + public Boolean getMaskDetectedFirstImage() { + return maskDetectedFirstImage; + } + + + public void setMaskDetectedFirstImage(Boolean maskDetectedFirstImage) { + this.maskDetectedFirstImage = maskDetectedFirstImage; + } + + + public FaceMatchResponseSchema maskDetectedScoreFirstImage(String maskDetectedScoreFirstImage) { + + this.maskDetectedScoreFirstImage = maskDetectedScoreFirstImage; + return this; + } + + /** + * It displays the score of the mask detection analysis for image 1. + * @return maskDetectedScoreFirstImage + **/ + @javax.annotation.Nullable + @Schema(example = "70", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score of the mask detection analysis for image 1.") + public String getMaskDetectedScoreFirstImage() { + return maskDetectedScoreFirstImage; + } + + + public void setMaskDetectedScoreFirstImage(String maskDetectedScoreFirstImage) { + this.maskDetectedScoreFirstImage = maskDetectedScoreFirstImage; + } + + + public FaceMatchResponseSchema maskDetectedSecondImage(Boolean maskDetectedSecondImage) { + + this.maskDetectedSecondImage = maskDetectedSecondImage; + return this; + } + + /** + * It displays whether the individual in the image 1 is wearing a mask. + * @return maskDetectedSecondImage + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the individual in the image 1 is wearing a mask.") + public Boolean getMaskDetectedSecondImage() { + return maskDetectedSecondImage; + } + + + public void setMaskDetectedSecondImage(Boolean maskDetectedSecondImage) { + this.maskDetectedSecondImage = maskDetectedSecondImage; + } + + + public FaceMatchResponseSchema maskDetectedScoreSecondImage(String maskDetectedScoreSecondImage) { + + this.maskDetectedScoreSecondImage = maskDetectedScoreSecondImage; + return this; + } + + /** + * It displays the score of the mask detection analysis for image 2. + * @return maskDetectedScoreSecondImage + **/ + @javax.annotation.Nullable + @Schema(example = "70", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score of the mask detection analysis for image 2.") + public String getMaskDetectedScoreSecondImage() { + return maskDetectedScoreSecondImage; + } + + + public void setMaskDetectedScoreSecondImage(String maskDetectedScoreSecondImage) { + this.maskDetectedScoreSecondImage = maskDetectedScoreSecondImage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaceMatchResponseSchema faceMatchResponseSchema = (FaceMatchResponseSchema) o; + return Objects.equals(this.status, faceMatchResponseSchema.status) && + Objects.equals(this.refId, faceMatchResponseSchema.refId) && + Objects.equals(this.verificationId, faceMatchResponseSchema.verificationId) && + Objects.equals(this.faceMatchResult, faceMatchResponseSchema.faceMatchResult) && + Objects.equals(this.faceMatchScore, faceMatchResponseSchema.faceMatchScore) && + Objects.equals(this.maskDetectedFirstImage, faceMatchResponseSchema.maskDetectedFirstImage) && + Objects.equals(this.maskDetectedScoreFirstImage, faceMatchResponseSchema.maskDetectedScoreFirstImage) && + Objects.equals(this.maskDetectedSecondImage, faceMatchResponseSchema.maskDetectedSecondImage) && + Objects.equals(this.maskDetectedScoreSecondImage, faceMatchResponseSchema.maskDetectedScoreSecondImage); + } + + @Override + public int hashCode() { + return Objects.hash(status, refId, verificationId, faceMatchResult, faceMatchScore, maskDetectedFirstImage, maskDetectedScoreFirstImage, maskDetectedSecondImage, maskDetectedScoreSecondImage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaceMatchResponseSchema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" refId: ").append(toIndentedString(refId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" faceMatchResult: ").append(toIndentedString(faceMatchResult)).append("\n"); + sb.append(" faceMatchScore: ").append(toIndentedString(faceMatchScore)).append("\n"); + sb.append(" maskDetectedFirstImage: ").append(toIndentedString(maskDetectedFirstImage)).append("\n"); + sb.append(" maskDetectedScoreFirstImage: ").append(toIndentedString(maskDetectedScoreFirstImage)).append("\n"); + sb.append(" maskDetectedSecondImage: ").append(toIndentedString(maskDetectedSecondImage)).append("\n"); + sb.append(" maskDetectedScoreSecondImage: ").append(toIndentedString(maskDetectedScoreSecondImage)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("ref_id"); + openapiFields.add("verification_id"); + openapiFields.add("face_match_result"); + openapiFields.add("face_match_score"); + openapiFields.add("maskDetected_first_image"); + openapiFields.add("maskDetected_score_first_image"); + openapiFields.add("maskDetected_second_image"); + openapiFields.add("maskDetected_score_second_image"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 FaceMatchResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("face_match_result") != null && !jsonObj.get("face_match_result").isJsonNull()) && !jsonObj.get("face_match_result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `face_match_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("face_match_result").toString())); + } + if ((jsonObj.get("maskDetected_score_first_image") != null && !jsonObj.get("maskDetected_score_first_image").isJsonNull()) && !jsonObj.get("maskDetected_score_first_image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maskDetected_score_first_image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskDetected_score_first_image").toString())); + } + if ((jsonObj.get("maskDetected_score_second_image") != null && !jsonObj.get("maskDetected_score_second_image").isJsonNull()) && !jsonObj.get("maskDetected_score_second_image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maskDetected_score_second_image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskDetected_score_second_image").toString())); + } + } + + + /** + * 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 FaceMatchResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("face_match_result") != null && !jsonObj.get("face_match_result").isJsonNull()) && !jsonObj.get("face_match_result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `face_match_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("face_match_result").toString())); + } + if ((jsonObj.get("maskDetected_score_first_image") != null && !jsonObj.get("maskDetected_score_first_image").isJsonNull()) && !jsonObj.get("maskDetected_score_first_image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maskDetected_score_first_image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskDetected_score_first_image").toString())); + } + if ((jsonObj.get("maskDetected_score_second_image") != null && !jsonObj.get("maskDetected_score_second_image").isJsonNull()) && !jsonObj.get("maskDetected_score_second_image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maskDetected_score_second_image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskDetected_score_second_image").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FaceMatchResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FaceMatchResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FaceMatchResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FaceMatchResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FaceMatchResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FaceMatchResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of FaceMatchResponseSchema + * @throws IOException if the JSON string is invalid with respect to FaceMatchResponseSchema + */ + public static FaceMatchResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FaceMatchResponseSchema.class); + } + + /** + * Convert an instance of FaceMatchResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/GetPanBulkResponseSchema.java b/src/main/java/com/cashfree/model/GetPanBulkResponseSchema.java new file mode 100644 index 0000000..31590bd --- /dev/null +++ b/src/main/java/com/cashfree/model/GetPanBulkResponseSchema.java @@ -0,0 +1,348 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.GetVerifyPanResponseSchema; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Response for Verify Bulk PAN API + */ +@Schema(description = "Response for Verify Bulk PAN API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class GetPanBulkResponseSchema { + public static final String SERIALIZED_NAME_BULK_VERIFICATION_ID = "bulk_verification_id"; + @SerializedName(SERIALIZED_NAME_BULK_VERIFICATION_ID) + private String bulkVerificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public static final String SERIALIZED_NAME_COUNT = "count"; + @SerializedName(SERIALIZED_NAME_COUNT) + private Long count; + + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + private List entries; + + public GetPanBulkResponseSchema() { + } + + public GetPanBulkResponseSchema bulkVerificationId(String bulkVerificationId) { + + this.bulkVerificationId = bulkVerificationId; + return this; + } + + /** + * It displays the unique ID created by you to identify the bulk verification request. + * @return bulkVerificationId + **/ + @javax.annotation.Nullable + @Schema(example = "1123456", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by you to identify the bulk verification request.") + public String getBulkVerificationId() { + return bulkVerificationId; + } + + + public void setBulkVerificationId(String bulkVerificationId) { + this.bulkVerificationId = bulkVerificationId; + } + + + public GetPanBulkResponseSchema referenceId(String referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "515", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public String getReferenceId() { + return referenceId; + } + + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + public GetPanBulkResponseSchema count(Long count) { + + this.count = count; + return this; + } + + /** + * Get count + * @return count + **/ + @javax.annotation.Nullable + @Schema(example = "1", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public Long getCount() { + return count; + } + + + public void setCount(Long count) { + this.count = count; + } + + + public GetPanBulkResponseSchema entries(List entries) { + + this.entries = entries; + return this; + } + + public GetPanBulkResponseSchema addEntriesItem(GetVerifyPanResponseSchema entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * It contains the details of PAN for verification. + * @return entries + **/ + @javax.annotation.Nullable + @Schema(example = "{\"father_name\":\"John Doe\",\"message\":\"VALID\",\"name_match_result\":\"PARTIAL\",\"name_match_score\":\"0.7\",\"name_provided\":\"John De\",\"pan\":\"ABCDP3011E\",\"reference_id\":1234567,\"registered_name\":\"John Doe\",\"status_code\":\"VALID\",\"type\":\"Individual\",\"valid\":true}", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It contains the details of PAN for verification.") + public List getEntries() { + return entries; + } + + + public void setEntries(List entries) { + this.entries = entries; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPanBulkResponseSchema getPanBulkResponseSchema = (GetPanBulkResponseSchema) o; + return Objects.equals(this.bulkVerificationId, getPanBulkResponseSchema.bulkVerificationId) && + Objects.equals(this.referenceId, getPanBulkResponseSchema.referenceId) && + Objects.equals(this.count, getPanBulkResponseSchema.count) && + Objects.equals(this.entries, getPanBulkResponseSchema.entries); + } + + @Override + public int hashCode() { + return Objects.hash(bulkVerificationId, referenceId, count, entries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPanBulkResponseSchema {\n"); + sb.append(" bulkVerificationId: ").append(toIndentedString(bulkVerificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bulk_verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("count"); + openapiFields.add("entries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 GetPanBulkResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bulk_verification_id") != null && !jsonObj.get("bulk_verification_id").isJsonNull()) && !jsonObj.get("bulk_verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bulk_verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bulk_verification_id").toString())); + } + if ((jsonObj.get("reference_id") != null && !jsonObj.get("reference_id").isJsonNull()) && !jsonObj.get("reference_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference_id").toString())); + } + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + if (!jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `entries` to be an array in the JSON string but got `%s`", jsonObj.get("entries").toString())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + GetVerifyPanResponseSchema.validateJsonElement(jsonArrayentries.get(i)); + }; + } + } + } + + + /** + * 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 GetPanBulkResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bulk_verification_id") != null && !jsonObj.get("bulk_verification_id").isJsonNull()) && !jsonObj.get("bulk_verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bulk_verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bulk_verification_id").toString())); + } + if ((jsonObj.get("reference_id") != null && !jsonObj.get("reference_id").isJsonNull()) && !jsonObj.get("reference_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference_id").toString())); + } + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + if (!jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `entries` to be an array in the JSON string but got `%s`", jsonObj.get("entries").toString())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + GetVerifyPanResponseSchema.validateJsonElement(jsonArrayentries.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPanBulkResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPanBulkResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPanBulkResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPanBulkResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPanBulkResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPanBulkResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPanBulkResponseSchema + * @throws IOException if the JSON string is invalid with respect to GetPanBulkResponseSchema + */ + public static GetPanBulkResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPanBulkResponseSchema.class); + } + + /** + * Convert an instance of GetPanBulkResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/GetStatusRpdResponseSchema.java b/src/main/java/com/cashfree/model/GetStatusRpdResponseSchema.java new file mode 100644 index 0000000..442fde4 --- /dev/null +++ b/src/main/java/com/cashfree/model/GetStatusRpdResponseSchema.java @@ -0,0 +1,706 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Reverse penny drop verification successful + */ +@Schema(description = "Reverse penny drop verification successful") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class GetStatusRpdResponseSchema { + public static final String SERIALIZED_NAME_BANK_ACCOUNT = "bank_account"; + @SerializedName(SERIALIZED_NAME_BANK_ACCOUNT) + private String bankAccount; + + public static final String SERIALIZED_NAME_IFSC = "ifsc"; + @SerializedName(SERIALIZED_NAME_IFSC) + private String ifsc; + + public static final String SERIALIZED_NAME_UPI = "upi"; + @SerializedName(SERIALIZED_NAME_UPI) + private String upi; + + public static final String SERIALIZED_NAME_NAME_AT_BANK = "name_at_bank"; + @SerializedName(SERIALIZED_NAME_NAME_AT_BANK) + private String nameAtBank; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REF_ID = "ref_id"; + @SerializedName(SERIALIZED_NAME_REF_ID) + private String refId; + + public static final String SERIALIZED_NAME_UTR = "utr"; + @SerializedName(SERIALIZED_NAME_UTR) + private String utr; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_NAME_MATCH_SCORE = "name_match_score"; + @SerializedName(SERIALIZED_NAME_NAME_MATCH_SCORE) + private String nameMatchScore; + + public static final String SERIALIZED_NAME_NAME_MATCH_RESULT = "name_match_result"; + @SerializedName(SERIALIZED_NAME_NAME_MATCH_RESULT) + private String nameMatchResult; + + public static final String SERIALIZED_NAME_ADDED_ON = "added_on"; + @SerializedName(SERIALIZED_NAME_ADDED_ON) + private String addedOn; + + public static final String SERIALIZED_NAME_PROCESSED_ON = "processed_on"; + @SerializedName(SERIALIZED_NAME_PROCESSED_ON) + private String processedOn; + + public static final String SERIALIZED_NAME_PENNY_COLLECTED_ON = "penny_collected_on"; + @SerializedName(SERIALIZED_NAME_PENNY_COLLECTED_ON) + private String pennyCollectedOn; + + public static final String SERIALIZED_NAME_REVERSAL_STATUS = "reversal_status"; + @SerializedName(SERIALIZED_NAME_REVERSAL_STATUS) + private String reversalStatus; + + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "account_type"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private String accountType; + + public GetStatusRpdResponseSchema() { + } + + public GetStatusRpdResponseSchema bankAccount(String bankAccount) { + + this.bankAccount = bankAccount; + return this; + } + + /** + * It displays the bank account number of the individual. + * @return bankAccount + **/ + @javax.annotation.Nullable + @Schema(example = "26291800001191", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the bank account number of the individual.") + public String getBankAccount() { + return bankAccount; + } + + + public void setBankAccount(String bankAccount) { + this.bankAccount = bankAccount; + } + + + public GetStatusRpdResponseSchema ifsc(String ifsc) { + + this.ifsc = ifsc; + return this; + } + + /** + * It displays the IFSC information of the individual's bank account. + * @return ifsc + **/ + @javax.annotation.Nullable + @Schema(example = "YESB0000262", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the IFSC information of the individual's bank account.") + public String getIfsc() { + return ifsc; + } + + + public void setIfsc(String ifsc) { + this.ifsc = ifsc; + } + + + public GetStatusRpdResponseSchema upi(String upi) { + + this.upi = upi; + return this; + } + + /** + * It displays the UPI VPA information of the individual. + * @return upi + **/ + @javax.annotation.Nullable + @Schema(example = "success@upi", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the UPI VPA information of the individual.") + public String getUpi() { + return upi; + } + + + public void setUpi(String upi) { + this.upi = upi; + } + + + public GetStatusRpdResponseSchema nameAtBank(String nameAtBank) { + + this.nameAtBank = nameAtBank; + return this; + } + + /** + * It displays the name of the individual registered in the bank records. + * @return nameAtBank + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN DOE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the individual registered in the bank records.") + public String getNameAtBank() { + return nameAtBank; + } + + + public void setNameAtBank(String nameAtBank) { + this.nameAtBank = nameAtBank; + } + + + public GetStatusRpdResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID created by you to identify the verifiation request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "32", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by you to identify the verifiation request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public GetStatusRpdResponseSchema refId(String refId) { + + this.refId = refId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return refId + **/ + @javax.annotation.Nullable + @Schema(example = "33", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public String getRefId() { + return refId; + } + + + public void setRefId(String refId) { + this.refId = refId; + } + + + public GetStatusRpdResponseSchema utr(String utr) { + + this.utr = utr; + return this; + } + + /** + * It displays the unique transaction reference (UTR) number created by the bank to identify the transaction. + * @return utr + **/ + @javax.annotation.Nullable + @Schema(example = "33", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique transaction reference (UTR) number created by the bank to identify the transaction.") + public String getUtr() { + return utr; + } + + + public void setUtr(String utr) { + this.utr = utr; + } + + + public GetStatusRpdResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public GetStatusRpdResponseSchema nameMatchScore(String nameMatchScore) { + + this.nameMatchScore = nameMatchScore; + return this; + } + + /** + * It displays the score of the name match verification. + * @return nameMatchScore + **/ + @javax.annotation.Nullable + @Schema(example = "10", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score of the name match verification.") + public String getNameMatchScore() { + return nameMatchScore; + } + + + public void setNameMatchScore(String nameMatchScore) { + this.nameMatchScore = nameMatchScore; + } + + + public GetStatusRpdResponseSchema nameMatchResult(String nameMatchResult) { + + this.nameMatchResult = nameMatchResult; + return this; + } + + /** + * It displays the result of the name match verification. + * @return nameMatchResult + **/ + @javax.annotation.Nullable + @Schema(example = "POOR_PARTIAL_MATCH", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the result of the name match verification.") + public String getNameMatchResult() { + return nameMatchResult; + } + + + public void setNameMatchResult(String nameMatchResult) { + this.nameMatchResult = nameMatchResult; + } + + + public GetStatusRpdResponseSchema addedOn(String addedOn) { + + this.addedOn = addedOn; + return this; + } + + /** + * It displays the date and time of when the request was added. + * @return addedOn + **/ + @javax.annotation.Nullable + @Schema(example = "2023-06-27T12:34:47+05:30", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date and time of when the request was added.") + public String getAddedOn() { + return addedOn; + } + + + public void setAddedOn(String addedOn) { + this.addedOn = addedOn; + } + + + public GetStatusRpdResponseSchema processedOn(String processedOn) { + + this.processedOn = processedOn; + return this; + } + + /** + * It displays the date and time of when the request was processed. + * @return processedOn + **/ + @javax.annotation.Nullable + @Schema(example = "2023-06-27T18:15:02+05:30", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date and time of when the request was processed.") + public String getProcessedOn() { + return processedOn; + } + + + public void setProcessedOn(String processedOn) { + this.processedOn = processedOn; + } + + + public GetStatusRpdResponseSchema pennyCollectedOn(String pennyCollectedOn) { + + this.pennyCollectedOn = pennyCollectedOn; + return this; + } + + /** + * It displays the date and time of when the 1 rupee was collected. + * @return pennyCollectedOn + **/ + @javax.annotation.Nullable + @Schema(example = "2022-10-27T12:40:10+05:30", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date and time of when the 1 rupee was collected.") + public String getPennyCollectedOn() { + return pennyCollectedOn; + } + + + public void setPennyCollectedOn(String pennyCollectedOn) { + this.pennyCollectedOn = pennyCollectedOn; + } + + + public GetStatusRpdResponseSchema reversalStatus(String reversalStatus) { + + this.reversalStatus = reversalStatus; + return this; + } + + /** + * It displays the status of the rupee reversal. + * @return reversalStatus + **/ + @javax.annotation.Nullable + @Schema(example = "PENDING", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the rupee reversal.") + public String getReversalStatus() { + return reversalStatus; + } + + + public void setReversalStatus(String reversalStatus) { + this.reversalStatus = reversalStatus; + } + + + public GetStatusRpdResponseSchema accountType(String accountType) { + + this.accountType = accountType; + return this; + } + + /** + * It displays the type of account. + * @return accountType + **/ + @javax.annotation.Nullable + @Schema(example = "SAVINGS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of account.") + public String getAccountType() { + return accountType; + } + + + public void setAccountType(String accountType) { + this.accountType = accountType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatusRpdResponseSchema getStatusRpdResponseSchema = (GetStatusRpdResponseSchema) o; + return Objects.equals(this.bankAccount, getStatusRpdResponseSchema.bankAccount) && + Objects.equals(this.ifsc, getStatusRpdResponseSchema.ifsc) && + Objects.equals(this.upi, getStatusRpdResponseSchema.upi) && + Objects.equals(this.nameAtBank, getStatusRpdResponseSchema.nameAtBank) && + Objects.equals(this.verificationId, getStatusRpdResponseSchema.verificationId) && + Objects.equals(this.refId, getStatusRpdResponseSchema.refId) && + Objects.equals(this.utr, getStatusRpdResponseSchema.utr) && + Objects.equals(this.status, getStatusRpdResponseSchema.status) && + Objects.equals(this.nameMatchScore, getStatusRpdResponseSchema.nameMatchScore) && + Objects.equals(this.nameMatchResult, getStatusRpdResponseSchema.nameMatchResult) && + Objects.equals(this.addedOn, getStatusRpdResponseSchema.addedOn) && + Objects.equals(this.processedOn, getStatusRpdResponseSchema.processedOn) && + Objects.equals(this.pennyCollectedOn, getStatusRpdResponseSchema.pennyCollectedOn) && + Objects.equals(this.reversalStatus, getStatusRpdResponseSchema.reversalStatus) && + Objects.equals(this.accountType, getStatusRpdResponseSchema.accountType); + } + + @Override + public int hashCode() { + return Objects.hash(bankAccount, ifsc, upi, nameAtBank, verificationId, refId, utr, status, nameMatchScore, nameMatchResult, addedOn, processedOn, pennyCollectedOn, reversalStatus, accountType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStatusRpdResponseSchema {\n"); + sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n"); + sb.append(" ifsc: ").append(toIndentedString(ifsc)).append("\n"); + sb.append(" upi: ").append(toIndentedString(upi)).append("\n"); + sb.append(" nameAtBank: ").append(toIndentedString(nameAtBank)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" refId: ").append(toIndentedString(refId)).append("\n"); + sb.append(" utr: ").append(toIndentedString(utr)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" nameMatchScore: ").append(toIndentedString(nameMatchScore)).append("\n"); + sb.append(" nameMatchResult: ").append(toIndentedString(nameMatchResult)).append("\n"); + sb.append(" addedOn: ").append(toIndentedString(addedOn)).append("\n"); + sb.append(" processedOn: ").append(toIndentedString(processedOn)).append("\n"); + sb.append(" pennyCollectedOn: ").append(toIndentedString(pennyCollectedOn)).append("\n"); + sb.append(" reversalStatus: ").append(toIndentedString(reversalStatus)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bank_account"); + openapiFields.add("ifsc"); + openapiFields.add("upi"); + openapiFields.add("name_at_bank"); + openapiFields.add("verification_id"); + openapiFields.add("ref_id"); + openapiFields.add("utr"); + openapiFields.add("status"); + openapiFields.add("name_match_score"); + openapiFields.add("name_match_result"); + openapiFields.add("added_on"); + openapiFields.add("processed_on"); + openapiFields.add("penny_collected_on"); + openapiFields.add("reversal_status"); + openapiFields.add("account_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 GetStatusRpdResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bank_account") != null && !jsonObj.get("bank_account").isJsonNull()) && !jsonObj.get("bank_account").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_account").toString())); + } + if ((jsonObj.get("ifsc") != null && !jsonObj.get("ifsc").isJsonNull()) && !jsonObj.get("ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ifsc").toString())); + } + if ((jsonObj.get("upi") != null && !jsonObj.get("upi").isJsonNull()) && !jsonObj.get("upi").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `upi` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upi").toString())); + } + if ((jsonObj.get("name_at_bank") != null && !jsonObj.get("name_at_bank").isJsonNull()) && !jsonObj.get("name_at_bank").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_at_bank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_at_bank").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("ref_id") != null && !jsonObj.get("ref_id").isJsonNull()) && !jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + if ((jsonObj.get("utr") != null && !jsonObj.get("utr").isJsonNull()) && !jsonObj.get("utr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `utr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("utr").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("name_match_score") != null && !jsonObj.get("name_match_score").isJsonNull()) && !jsonObj.get("name_match_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_score").toString())); + } + if ((jsonObj.get("name_match_result") != null && !jsonObj.get("name_match_result").isJsonNull()) && !jsonObj.get("name_match_result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_result").toString())); + } + if ((jsonObj.get("added_on") != null && !jsonObj.get("added_on").isJsonNull()) && !jsonObj.get("added_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `added_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("added_on").toString())); + } + if ((jsonObj.get("processed_on") != null && !jsonObj.get("processed_on").isJsonNull()) && !jsonObj.get("processed_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processed_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processed_on").toString())); + } + if ((jsonObj.get("penny_collected_on") != null && !jsonObj.get("penny_collected_on").isJsonNull()) && !jsonObj.get("penny_collected_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `penny_collected_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("penny_collected_on").toString())); + } + if ((jsonObj.get("reversal_status") != null && !jsonObj.get("reversal_status").isJsonNull()) && !jsonObj.get("reversal_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reversal_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reversal_status").toString())); + } + if ((jsonObj.get("account_type") != null && !jsonObj.get("account_type").isJsonNull()) && !jsonObj.get("account_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_type").toString())); + } + } + + + /** + * 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 GetStatusRpdResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bank_account") != null && !jsonObj.get("bank_account").isJsonNull()) && !jsonObj.get("bank_account").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_account").toString())); + } + if ((jsonObj.get("ifsc") != null && !jsonObj.get("ifsc").isJsonNull()) && !jsonObj.get("ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ifsc").toString())); + } + if ((jsonObj.get("upi") != null && !jsonObj.get("upi").isJsonNull()) && !jsonObj.get("upi").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `upi` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upi").toString())); + } + if ((jsonObj.get("name_at_bank") != null && !jsonObj.get("name_at_bank").isJsonNull()) && !jsonObj.get("name_at_bank").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_at_bank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_at_bank").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("ref_id") != null && !jsonObj.get("ref_id").isJsonNull()) && !jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + if ((jsonObj.get("utr") != null && !jsonObj.get("utr").isJsonNull()) && !jsonObj.get("utr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `utr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("utr").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("name_match_score") != null && !jsonObj.get("name_match_score").isJsonNull()) && !jsonObj.get("name_match_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_score").toString())); + } + if ((jsonObj.get("name_match_result") != null && !jsonObj.get("name_match_result").isJsonNull()) && !jsonObj.get("name_match_result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_result").toString())); + } + if ((jsonObj.get("added_on") != null && !jsonObj.get("added_on").isJsonNull()) && !jsonObj.get("added_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `added_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("added_on").toString())); + } + if ((jsonObj.get("processed_on") != null && !jsonObj.get("processed_on").isJsonNull()) && !jsonObj.get("processed_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processed_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processed_on").toString())); + } + if ((jsonObj.get("penny_collected_on") != null && !jsonObj.get("penny_collected_on").isJsonNull()) && !jsonObj.get("penny_collected_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `penny_collected_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("penny_collected_on").toString())); + } + if ((jsonObj.get("reversal_status") != null && !jsonObj.get("reversal_status").isJsonNull()) && !jsonObj.get("reversal_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reversal_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reversal_status").toString())); + } + if ((jsonObj.get("account_type") != null && !jsonObj.get("account_type").isJsonNull()) && !jsonObj.get("account_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_type").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStatusRpdResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStatusRpdResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStatusRpdResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStatusRpdResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStatusRpdResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStatusRpdResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStatusRpdResponseSchema + * @throws IOException if the JSON string is invalid with respect to GetStatusRpdResponseSchema + */ + public static GetStatusRpdResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStatusRpdResponseSchema.class); + } + + /** + * Convert an instance of GetStatusRpdResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/GetVerifyPanResponseSchema.java b/src/main/java/com/cashfree/model/GetVerifyPanResponseSchema.java new file mode 100644 index 0000000..3121f1b --- /dev/null +++ b/src/main/java/com/cashfree/model/GetVerifyPanResponseSchema.java @@ -0,0 +1,694 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Verify PAN Sync API + */ +@Schema(description = "Success response for Verify PAN Sync API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class GetVerifyPanResponseSchema { + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Long referenceId; + + public static final String SERIALIZED_NAME_NAME_PROVIDED = "name_provided"; + @SerializedName(SERIALIZED_NAME_NAME_PROVIDED) + private String nameProvided; + + public static final String SERIALIZED_NAME_REGISTERED_NAME = "registered_name"; + @SerializedName(SERIALIZED_NAME_REGISTERED_NAME) + private String registeredName; + + public static final String SERIALIZED_NAME_VALID = "valid"; + @SerializedName(SERIALIZED_NAME_VALID) + private Boolean valid; + + public static final String SERIALIZED_NAME_FATHER_NAME = "father_name"; + @SerializedName(SERIALIZED_NAME_FATHER_NAME) + private String fatherName; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_NAME_MATCH_SCORE = "name_match_score"; + @SerializedName(SERIALIZED_NAME_NAME_MATCH_SCORE) + private String nameMatchScore; + + public static final String SERIALIZED_NAME_NAME_MATCH_RESULT = "name_match_result"; + @SerializedName(SERIALIZED_NAME_NAME_MATCH_RESULT) + private String nameMatchResult; + + public static final String SERIALIZED_NAME_AADHAAR_SEEDING_STATUS = "aadhaar_seeding_status"; + @SerializedName(SERIALIZED_NAME_AADHAAR_SEEDING_STATUS) + private String aadhaarSeedingStatus; + + public static final String SERIALIZED_NAME_LAST_UPDATED_AT = "last_updated_at"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATED_AT) + private String lastUpdatedAt; + + public static final String SERIALIZED_NAME_NAME_PAN_CARD = "name_pan_card"; + @SerializedName(SERIALIZED_NAME_NAME_PAN_CARD) + private String namePanCard; + + public static final String SERIALIZED_NAME_PAN_STATUS = "pan_status"; + @SerializedName(SERIALIZED_NAME_PAN_STATUS) + private String panStatus; + + public static final String SERIALIZED_NAME_AADHAAR_SEEDING_STATUS_DESC = "aadhaar_seeding_status_desc"; + @SerializedName(SERIALIZED_NAME_AADHAAR_SEEDING_STATUS_DESC) + private String aadhaarSeedingStatusDesc; + + public GetVerifyPanResponseSchema() { + } + + public GetVerifyPanResponseSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It displays the unique 10-character alphanumeric identifier issued by the Income Tax Department. + * @return pan + **/ + @javax.annotation.Nullable + @Schema(example = "ABCPV1234D", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique 10-character alphanumeric identifier issued by the Income Tax Department.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public GetVerifyPanResponseSchema type(String type) { + + this.type = type; + return this; + } + + /** + * It displays the type of the PAN issued. + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "Individual", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of the PAN issued.") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public GetVerifyPanResponseSchema referenceId(Long referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "161", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Long getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Long referenceId) { + this.referenceId = referenceId; + } + + + public GetVerifyPanResponseSchema nameProvided(String nameProvided) { + + this.nameProvided = nameProvided; + return this; + } + + /** + * It displays the name entered in the API request. + * @return nameProvided + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN DOE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name entered in the API request.") + public String getNameProvided() { + return nameProvided; + } + + + public void setNameProvided(String nameProvided) { + this.nameProvided = nameProvided; + } + + + public GetVerifyPanResponseSchema registeredName(String registeredName) { + + this.registeredName = registeredName; + return this; + } + + /** + * It displays the PAN registered name. + * @return registeredName + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN DOE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PAN registered name.") + public String getRegisteredName() { + return registeredName; + } + + + public void setRegisteredName(String registeredName) { + this.registeredName = registeredName; + } + + + public GetVerifyPanResponseSchema valid(Boolean valid) { + + this.valid = valid; + return this; + } + + /** + * It displays the status of the PAN card. + * @return valid + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the PAN card.") + public Boolean getValid() { + return valid; + } + + + public void setValid(Boolean valid) { + this.valid = valid; + } + + + public GetVerifyPanResponseSchema fatherName(String fatherName) { + + this.fatherName = fatherName; + return this; + } + + /** + * It displays the father's name of the PAN card holder. + * @return fatherName + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the father's name of the PAN card holder.") + public String getFatherName() { + return fatherName; + } + + + public void setFatherName(String fatherName) { + this.fatherName = fatherName; + } + + + public GetVerifyPanResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "PAN verified successfully", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public GetVerifyPanResponseSchema nameMatchScore(String nameMatchScore) { + + this.nameMatchScore = nameMatchScore; + return this; + } + + /** + * It displays the score for the name match verification. + * @return nameMatchScore + **/ + @javax.annotation.Nullable + @Schema(example = "100.00", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score for the name match verification.") + public String getNameMatchScore() { + return nameMatchScore; + } + + + public void setNameMatchScore(String nameMatchScore) { + this.nameMatchScore = nameMatchScore; + } + + + public GetVerifyPanResponseSchema nameMatchResult(String nameMatchResult) { + + this.nameMatchResult = nameMatchResult; + return this; + } + + /** + * It displays the result of the name match verification. + * @return nameMatchResult + **/ + @javax.annotation.Nullable + @Schema(example = "DIRECT_MATCH", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the result of the name match verification.") + public String getNameMatchResult() { + return nameMatchResult; + } + + + public void setNameMatchResult(String nameMatchResult) { + this.nameMatchResult = nameMatchResult; + } + + + public GetVerifyPanResponseSchema aadhaarSeedingStatus(String aadhaarSeedingStatus) { + + this.aadhaarSeedingStatus = aadhaarSeedingStatus; + return this; + } + + /** + * It displays whether the individual linked the aadhaar information with PAN. + * @return aadhaarSeedingStatus + **/ + @javax.annotation.Nullable + @Schema(example = "Y", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the individual linked the aadhaar information with PAN.") + public String getAadhaarSeedingStatus() { + return aadhaarSeedingStatus; + } + + + public void setAadhaarSeedingStatus(String aadhaarSeedingStatus) { + this.aadhaarSeedingStatus = aadhaarSeedingStatus; + } + + + public GetVerifyPanResponseSchema lastUpdatedAt(String lastUpdatedAt) { + + this.lastUpdatedAt = lastUpdatedAt; + return this; + } + + /** + * It displays the last updated date. + * @return lastUpdatedAt + **/ + @javax.annotation.Nullable + @Schema(example = "01/01/2019", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the last updated date.") + public String getLastUpdatedAt() { + return lastUpdatedAt; + } + + + public void setLastUpdatedAt(String lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + } + + + public GetVerifyPanResponseSchema namePanCard(String namePanCard) { + + this.namePanCard = namePanCard; + return this; + } + + /** + * It displays the name displayed on the PAN card. + * @return namePanCard + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN DOE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name displayed on the PAN card.") + public String getNamePanCard() { + return namePanCard; + } + + + public void setNamePanCard(String namePanCard) { + this.namePanCard = namePanCard; + } + + + public GetVerifyPanResponseSchema panStatus(String panStatus) { + + this.panStatus = panStatus; + return this; + } + + /** + * It displays the status of the PAN card. + * @return panStatus + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the PAN card.") + public String getPanStatus() { + return panStatus; + } + + + public void setPanStatus(String panStatus) { + this.panStatus = panStatus; + } + + + public GetVerifyPanResponseSchema aadhaarSeedingStatusDesc(String aadhaarSeedingStatusDesc) { + + this.aadhaarSeedingStatusDesc = aadhaarSeedingStatusDesc; + return this; + } + + /** + * It displays additional information of the linking of aadhaar and PAN card. + * @return aadhaarSeedingStatusDesc + **/ + @javax.annotation.Nullable + @Schema(example = "Aadhaar is linked to PAN", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays additional information of the linking of aadhaar and PAN card.") + public String getAadhaarSeedingStatusDesc() { + return aadhaarSeedingStatusDesc; + } + + + public void setAadhaarSeedingStatusDesc(String aadhaarSeedingStatusDesc) { + this.aadhaarSeedingStatusDesc = aadhaarSeedingStatusDesc; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetVerifyPanResponseSchema getVerifyPanResponseSchema = (GetVerifyPanResponseSchema) o; + return Objects.equals(this.pan, getVerifyPanResponseSchema.pan) && + Objects.equals(this.type, getVerifyPanResponseSchema.type) && + Objects.equals(this.referenceId, getVerifyPanResponseSchema.referenceId) && + Objects.equals(this.nameProvided, getVerifyPanResponseSchema.nameProvided) && + Objects.equals(this.registeredName, getVerifyPanResponseSchema.registeredName) && + Objects.equals(this.valid, getVerifyPanResponseSchema.valid) && + Objects.equals(this.fatherName, getVerifyPanResponseSchema.fatherName) && + Objects.equals(this.message, getVerifyPanResponseSchema.message) && + Objects.equals(this.nameMatchScore, getVerifyPanResponseSchema.nameMatchScore) && + Objects.equals(this.nameMatchResult, getVerifyPanResponseSchema.nameMatchResult) && + Objects.equals(this.aadhaarSeedingStatus, getVerifyPanResponseSchema.aadhaarSeedingStatus) && + Objects.equals(this.lastUpdatedAt, getVerifyPanResponseSchema.lastUpdatedAt) && + Objects.equals(this.namePanCard, getVerifyPanResponseSchema.namePanCard) && + Objects.equals(this.panStatus, getVerifyPanResponseSchema.panStatus) && + Objects.equals(this.aadhaarSeedingStatusDesc, getVerifyPanResponseSchema.aadhaarSeedingStatusDesc); + } + + @Override + public int hashCode() { + return Objects.hash(pan, type, referenceId, nameProvided, registeredName, valid, fatherName, message, nameMatchScore, nameMatchResult, aadhaarSeedingStatus, lastUpdatedAt, namePanCard, panStatus, aadhaarSeedingStatusDesc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetVerifyPanResponseSchema {\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" nameProvided: ").append(toIndentedString(nameProvided)).append("\n"); + sb.append(" registeredName: ").append(toIndentedString(registeredName)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append(" fatherName: ").append(toIndentedString(fatherName)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" nameMatchScore: ").append(toIndentedString(nameMatchScore)).append("\n"); + sb.append(" nameMatchResult: ").append(toIndentedString(nameMatchResult)).append("\n"); + sb.append(" aadhaarSeedingStatus: ").append(toIndentedString(aadhaarSeedingStatus)).append("\n"); + sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n"); + sb.append(" namePanCard: ").append(toIndentedString(namePanCard)).append("\n"); + sb.append(" panStatus: ").append(toIndentedString(panStatus)).append("\n"); + sb.append(" aadhaarSeedingStatusDesc: ").append(toIndentedString(aadhaarSeedingStatusDesc)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pan"); + openapiFields.add("type"); + openapiFields.add("reference_id"); + openapiFields.add("name_provided"); + openapiFields.add("registered_name"); + openapiFields.add("valid"); + openapiFields.add("father_name"); + openapiFields.add("message"); + openapiFields.add("name_match_score"); + openapiFields.add("name_match_result"); + openapiFields.add("aadhaar_seeding_status"); + openapiFields.add("last_updated_at"); + openapiFields.add("name_pan_card"); + openapiFields.add("pan_status"); + openapiFields.add("aadhaar_seeding_status_desc"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 GetVerifyPanResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("name_provided") != null && !jsonObj.get("name_provided").isJsonNull()) && !jsonObj.get("name_provided").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_provided` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_provided").toString())); + } + if ((jsonObj.get("registered_name") != null && !jsonObj.get("registered_name").isJsonNull()) && !jsonObj.get("registered_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registered_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registered_name").toString())); + } + if ((jsonObj.get("father_name") != null && !jsonObj.get("father_name").isJsonNull()) && !jsonObj.get("father_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father_name").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("name_match_score") != null && !jsonObj.get("name_match_score").isJsonNull()) && !jsonObj.get("name_match_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_score").toString())); + } + if ((jsonObj.get("name_match_result") != null && !jsonObj.get("name_match_result").isJsonNull()) && !jsonObj.get("name_match_result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_result").toString())); + } + if ((jsonObj.get("aadhaar_seeding_status") != null && !jsonObj.get("aadhaar_seeding_status").isJsonNull()) && !jsonObj.get("aadhaar_seeding_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar_seeding_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar_seeding_status").toString())); + } + if ((jsonObj.get("last_updated_at") != null && !jsonObj.get("last_updated_at").isJsonNull()) && !jsonObj.get("last_updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `last_updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_updated_at").toString())); + } + if ((jsonObj.get("name_pan_card") != null && !jsonObj.get("name_pan_card").isJsonNull()) && !jsonObj.get("name_pan_card").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_pan_card` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_pan_card").toString())); + } + if ((jsonObj.get("pan_status") != null && !jsonObj.get("pan_status").isJsonNull()) && !jsonObj.get("pan_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan_status").toString())); + } + if ((jsonObj.get("aadhaar_seeding_status_desc") != null && !jsonObj.get("aadhaar_seeding_status_desc").isJsonNull()) && !jsonObj.get("aadhaar_seeding_status_desc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar_seeding_status_desc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar_seeding_status_desc").toString())); + } + } + + + /** + * 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 GetVerifyPanResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("name_provided") != null && !jsonObj.get("name_provided").isJsonNull()) && !jsonObj.get("name_provided").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_provided` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_provided").toString())); + } + if ((jsonObj.get("registered_name") != null && !jsonObj.get("registered_name").isJsonNull()) && !jsonObj.get("registered_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registered_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registered_name").toString())); + } + if ((jsonObj.get("father_name") != null && !jsonObj.get("father_name").isJsonNull()) && !jsonObj.get("father_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father_name").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("name_match_score") != null && !jsonObj.get("name_match_score").isJsonNull()) && !jsonObj.get("name_match_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_score").toString())); + } + if ((jsonObj.get("name_match_result") != null && !jsonObj.get("name_match_result").isJsonNull()) && !jsonObj.get("name_match_result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_match_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_match_result").toString())); + } + if ((jsonObj.get("aadhaar_seeding_status") != null && !jsonObj.get("aadhaar_seeding_status").isJsonNull()) && !jsonObj.get("aadhaar_seeding_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar_seeding_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar_seeding_status").toString())); + } + if ((jsonObj.get("last_updated_at") != null && !jsonObj.get("last_updated_at").isJsonNull()) && !jsonObj.get("last_updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `last_updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_updated_at").toString())); + } + if ((jsonObj.get("name_pan_card") != null && !jsonObj.get("name_pan_card").isJsonNull()) && !jsonObj.get("name_pan_card").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_pan_card` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_pan_card").toString())); + } + if ((jsonObj.get("pan_status") != null && !jsonObj.get("pan_status").isJsonNull()) && !jsonObj.get("pan_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan_status").toString())); + } + if ((jsonObj.get("aadhaar_seeding_status_desc") != null && !jsonObj.get("aadhaar_seeding_status_desc").isJsonNull()) && !jsonObj.get("aadhaar_seeding_status_desc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar_seeding_status_desc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar_seeding_status_desc").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetVerifyPanResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetVerifyPanResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetVerifyPanResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetVerifyPanResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetVerifyPanResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetVerifyPanResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetVerifyPanResponseSchema + * @throws IOException if the JSON string is invalid with respect to GetVerifyPanResponseSchema + */ + public static GetVerifyPanResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetVerifyPanResponseSchema.class); + } + + /** + * Convert an instance of GetVerifyPanResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/GstinRequestSchema.java b/src/main/java/com/cashfree/model/GstinRequestSchema.java new file mode 100644 index 0000000..986542e --- /dev/null +++ b/src/main/java/com/cashfree/model/GstinRequestSchema.java @@ -0,0 +1,266 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify GSTIN information + */ +@Schema(description = "Find the request parameters to verify GSTIN information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class GstinRequestSchema { + public static final String SERIALIZED_NAME_G_S_T_I_N = "GSTIN"; + @SerializedName(SERIALIZED_NAME_G_S_T_I_N) + private String GSTIN = "22AAAAA0000A1Z5"; + + public static final String SERIALIZED_NAME_BUSINESS_NAME = "businessName"; + @SerializedName(SERIALIZED_NAME_BUSINESS_NAME) + private String businessName = "Cashfree"; + + public GstinRequestSchema() { + } + + public GstinRequestSchema GSTIN(String GSTIN) { + + this.GSTIN = GSTIN; + return this; + } + + /** + * It is the unique number assigned to businesses registered under the Goods and Services Tax (GST) system in India. + * @return GSTIN + **/ + @javax.annotation.Nonnull + @Schema(example = "22AAAAA0000A1Z5", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique number assigned to businesses registered under the Goods and Services Tax (GST) system in India.") + public String getGSTIN() { + return GSTIN; + } + + + public void setGSTIN(String GSTIN) { + this.GSTIN = GSTIN; + } + + + public GstinRequestSchema businessName(String businessName) { + + this.businessName = businessName; + return this; + } + + /** + * It is the name of the business to which the GSTIN is issued. The maximum character limit is 100. + * @return businessName + **/ + @javax.annotation.Nullable + @Schema(example = "Cashfree", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the business to which the GSTIN is issued. The maximum character limit is 100.") + public String getBusinessName() { + return businessName; + } + + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GstinRequestSchema gstinRequestSchema = (GstinRequestSchema) o; + return Objects.equals(this.GSTIN, gstinRequestSchema.GSTIN) && + Objects.equals(this.businessName, gstinRequestSchema.businessName); + } + + @Override + public int hashCode() { + return Objects.hash(GSTIN, businessName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GstinRequestSchema {\n"); + sb.append(" GSTIN: ").append(toIndentedString(GSTIN)).append("\n"); + sb.append(" businessName: ").append(toIndentedString(businessName)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("GSTIN"); + openapiFields.add("businessName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("GSTIN"); + } + + /** + * 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 GstinRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GstinRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("GSTIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GSTIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GSTIN").toString())); + } + if ((jsonObj.get("businessName") != null && !jsonObj.get("businessName").isJsonNull()) && !jsonObj.get("businessName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `businessName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessName").toString())); + } + } + + + /** + * 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 GstinRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GstinRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("GSTIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GSTIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GSTIN").toString())); + } + if ((jsonObj.get("businessName") != null && !jsonObj.get("businessName").isJsonNull()) && !jsonObj.get("businessName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `businessName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessName").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GstinRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GstinRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GstinRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GstinRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GstinRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GstinRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of GstinRequestSchema + * @throws IOException if the JSON string is invalid with respect to GstinRequestSchema + */ + public static GstinRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GstinRequestSchema.class); + } + + /** + * Convert an instance of GstinRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/GstinResponseSchema.java b/src/main/java/com/cashfree/model/GstinResponseSchema.java new file mode 100644 index 0000000..af83fd5 --- /dev/null +++ b/src/main/java/com/cashfree/model/GstinResponseSchema.java @@ -0,0 +1,807 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.GstinResponseSchemaAdditionalAddressArrayInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Verify GSTIN + */ +@Schema(description = "Success response for Verify GSTIN") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class GstinResponseSchema { + public static final String SERIALIZED_NAME_G_S_T_I_N = "GSTIN"; + @SerializedName(SERIALIZED_NAME_G_S_T_I_N) + private String GSTIN; + + public static final String SERIALIZED_NAME_ADDITIONAL_ADDRESS_ARRAY = "additional_address_array"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_ADDRESS_ARRAY) + private List additionalAddressArray; + + public static final String SERIALIZED_NAME_CANCELLATION_DATE = "cancellation_date"; + @SerializedName(SERIALIZED_NAME_CANCELLATION_DATE) + private String cancellationDate; + + public static final String SERIALIZED_NAME_CENTER_JURISDICTION = "center_jurisdiction"; + @SerializedName(SERIALIZED_NAME_CENTER_JURISDICTION) + private String centerJurisdiction; + + public static final String SERIALIZED_NAME_CONSTITUTION_OF_BUSINESS = "constitution_of_business"; + @SerializedName(SERIALIZED_NAME_CONSTITUTION_OF_BUSINESS) + private String constitutionOfBusiness; + + public static final String SERIALIZED_NAME_DATE_OF_REGISTRATION = "date_of_registration"; + @SerializedName(SERIALIZED_NAME_DATE_OF_REGISTRATION) + private String dateOfRegistration; + + public static final String SERIALIZED_NAME_GST_IN_STATUS = "gst_in_status"; + @SerializedName(SERIALIZED_NAME_GST_IN_STATUS) + private String gstInStatus; + + public static final String SERIALIZED_NAME_LAST_UPDATE_DATE = "last_update_date"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATE_DATE) + private String lastUpdateDate; + + public static final String SERIALIZED_NAME_LEGAL_NAME_OF_BUSINESS = "legal_name_of_business"; + @SerializedName(SERIALIZED_NAME_LEGAL_NAME_OF_BUSINESS) + private String legalNameOfBusiness; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_NATURE_OF_BUSINESS_ACTIVITIES = "nature_of_business_activities"; + @SerializedName(SERIALIZED_NAME_NATURE_OF_BUSINESS_ACTIVITIES) + private List natureOfBusinessActivities; + + public static final String SERIALIZED_NAME_PRINCIPAL_PLACE_ADDRESS = "principal_place_address"; + @SerializedName(SERIALIZED_NAME_PRINCIPAL_PLACE_ADDRESS) + private String principalPlaceAddress; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Long referenceId; + + public static final String SERIALIZED_NAME_STATE_JURISDICTION = "state_jurisdiction"; + @SerializedName(SERIALIZED_NAME_STATE_JURISDICTION) + private String stateJurisdiction; + + public static final String SERIALIZED_NAME_STATUS_CODE = "status_code"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private String statusCode; + + public static final String SERIALIZED_NAME_TAXPAYER_TYPE = "taxpayer_type"; + @SerializedName(SERIALIZED_NAME_TAXPAYER_TYPE) + private String taxpayerType; + + public static final String SERIALIZED_NAME_VALID = "valid"; + @SerializedName(SERIALIZED_NAME_VALID) + private Boolean valid; + + public GstinResponseSchema() { + } + + public GstinResponseSchema GSTIN(String GSTIN) { + + this.GSTIN = GSTIN; + return this; + } + + /** + * It displays the unique identification number assigned to business registered under the Goods and Services Tax (GST) system in India.\" + * @return GSTIN + **/ + @javax.annotation.Nullable + @Schema(example = "22ABCDE1234F1Z5", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique identification number assigned to business registered under the Goods and Services Tax (GST) system in India.\"") + public String getGSTIN() { + return GSTIN; + } + + + public void setGSTIN(String GSTIN) { + this.GSTIN = GSTIN; + } + + + public GstinResponseSchema additionalAddressArray(List additionalAddressArray) { + + this.additionalAddressArray = additionalAddressArray; + return this; + } + + public GstinResponseSchema addAdditionalAddressArrayItem(GstinResponseSchemaAdditionalAddressArrayInner additionalAddressArrayItem) { + if (this.additionalAddressArray == null) { + this.additionalAddressArray = new ArrayList<>(); + } + this.additionalAddressArray.add(additionalAddressArrayItem); + return this; + } + + /** + * Get additionalAddressArray + * @return additionalAddressArray + **/ + @javax.annotation.Nullable + @Schema(example = "{\"address\":\"Koramangala\"}", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getAdditionalAddressArray() { + return additionalAddressArray; + } + + + public void setAdditionalAddressArray(List additionalAddressArray) { + this.additionalAddressArray = additionalAddressArray; + } + + + public GstinResponseSchema cancellationDate(String cancellationDate) { + + this.cancellationDate = cancellationDate; + return this; + } + + /** + * Get cancellationDate + * @return cancellationDate + **/ + @javax.annotation.Nullable + @Schema(example = "2021-12-14", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getCancellationDate() { + return cancellationDate; + } + + + public void setCancellationDate(String cancellationDate) { + this.cancellationDate = cancellationDate; + } + + + public GstinResponseSchema centerJurisdiction(String centerJurisdiction) { + + this.centerJurisdiction = centerJurisdiction; + return this; + } + + /** + * Get centerJurisdiction + * @return centerJurisdiction + **/ + @javax.annotation.Nullable + @Schema(example = "RANGE - 21", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getCenterJurisdiction() { + return centerJurisdiction; + } + + + public void setCenterJurisdiction(String centerJurisdiction) { + this.centerJurisdiction = centerJurisdiction; + } + + + public GstinResponseSchema constitutionOfBusiness(String constitutionOfBusiness) { + + this.constitutionOfBusiness = constitutionOfBusiness; + return this; + } + + /** + * Get constitutionOfBusiness + * @return constitutionOfBusiness + **/ + @javax.annotation.Nullable + @Schema(example = "Private Limited", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getConstitutionOfBusiness() { + return constitutionOfBusiness; + } + + + public void setConstitutionOfBusiness(String constitutionOfBusiness) { + this.constitutionOfBusiness = constitutionOfBusiness; + } + + + public GstinResponseSchema dateOfRegistration(String dateOfRegistration) { + + this.dateOfRegistration = dateOfRegistration; + return this; + } + + /** + * Get dateOfRegistration + * @return dateOfRegistration + **/ + @javax.annotation.Nullable + @Schema(example = "2021-06-01", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getDateOfRegistration() { + return dateOfRegistration; + } + + + public void setDateOfRegistration(String dateOfRegistration) { + this.dateOfRegistration = dateOfRegistration; + } + + + public GstinResponseSchema gstInStatus(String gstInStatus) { + + this.gstInStatus = gstInStatus; + return this; + } + + /** + * Get gstInStatus + * @return gstInStatus + **/ + @javax.annotation.Nullable + @Schema(example = "Active", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getGstInStatus() { + return gstInStatus; + } + + + public void setGstInStatus(String gstInStatus) { + this.gstInStatus = gstInStatus; + } + + + public GstinResponseSchema lastUpdateDate(String lastUpdateDate) { + + this.lastUpdateDate = lastUpdateDate; + return this; + } + + /** + * Get lastUpdateDate + * @return lastUpdateDate + **/ + @javax.annotation.Nullable + @Schema(example = "2021-06-18", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getLastUpdateDate() { + return lastUpdateDate; + } + + + public void setLastUpdateDate(String lastUpdateDate) { + this.lastUpdateDate = lastUpdateDate; + } + + + public GstinResponseSchema legalNameOfBusiness(String legalNameOfBusiness) { + + this.legalNameOfBusiness = legalNameOfBusiness; + return this; + } + + /** + * Get legalNameOfBusiness + * @return legalNameOfBusiness + **/ + @javax.annotation.Nullable + @Schema(example = "ABC PVT LTD.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getLegalNameOfBusiness() { + return legalNameOfBusiness; + } + + + public void setLegalNameOfBusiness(String legalNameOfBusiness) { + this.legalNameOfBusiness = legalNameOfBusiness; + } + + + public GstinResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "GSTINExist", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public GstinResponseSchema natureOfBusinessActivities(List natureOfBusinessActivities) { + + this.natureOfBusinessActivities = natureOfBusinessActivities; + return this; + } + + public GstinResponseSchema addNatureOfBusinessActivitiesItem(String natureOfBusinessActivitiesItem) { + if (this.natureOfBusinessActivities == null) { + this.natureOfBusinessActivities = new ArrayList<>(); + } + this.natureOfBusinessActivities.add(natureOfBusinessActivitiesItem); + return this; + } + + /** + * Get natureOfBusinessActivities + * @return natureOfBusinessActivities + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getNatureOfBusinessActivities() { + return natureOfBusinessActivities; + } + + + public void setNatureOfBusinessActivities(List natureOfBusinessActivities) { + this.natureOfBusinessActivities = natureOfBusinessActivities; + } + + + public GstinResponseSchema principalPlaceAddress(String principalPlaceAddress) { + + this.principalPlaceAddress = principalPlaceAddress; + return this; + } + + /** + * Get principalPlaceAddress + * @return principalPlaceAddress + **/ + @javax.annotation.Nullable + @Schema(example = "NO 1A, PUNE, Maharashtra, 411006", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getPrincipalPlaceAddress() { + return principalPlaceAddress; + } + + + public void setPrincipalPlaceAddress(String principalPlaceAddress) { + this.principalPlaceAddress = principalPlaceAddress; + } + + + public GstinResponseSchema referenceId(Long referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * Get referenceId + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "12345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public Long getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Long referenceId) { + this.referenceId = referenceId; + } + + + public GstinResponseSchema stateJurisdiction(String stateJurisdiction) { + + this.stateJurisdiction = stateJurisdiction; + return this; + } + + /** + * Get stateJurisdiction + * @return stateJurisdiction + **/ + @javax.annotation.Nullable + @Schema(example = "Ward 9", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getStateJurisdiction() { + return stateJurisdiction; + } + + + public void setStateJurisdiction(String stateJurisdiction) { + this.stateJurisdiction = stateJurisdiction; + } + + + public GstinResponseSchema statusCode(String statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * Get statusCode + * @return statusCode + **/ + @javax.annotation.Nullable + @Schema(example = "22ABCDE1234F1Z5", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getStatusCode() { + return statusCode; + } + + + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + + public GstinResponseSchema taxpayerType(String taxpayerType) { + + this.taxpayerType = taxpayerType; + return this; + } + + /** + * Get taxpayerType + * @return taxpayerType + **/ + @javax.annotation.Nullable + @Schema(example = "Regular", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getTaxpayerType() { + return taxpayerType; + } + + + public void setTaxpayerType(String taxpayerType) { + this.taxpayerType = taxpayerType; + } + + + public GstinResponseSchema valid(Boolean valid) { + + this.valid = valid; + return this; + } + + /** + * Get valid + * @return valid + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public Boolean getValid() { + return valid; + } + + + public void setValid(Boolean valid) { + this.valid = valid; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GstinResponseSchema gstinResponseSchema = (GstinResponseSchema) o; + return Objects.equals(this.GSTIN, gstinResponseSchema.GSTIN) && + Objects.equals(this.additionalAddressArray, gstinResponseSchema.additionalAddressArray) && + Objects.equals(this.cancellationDate, gstinResponseSchema.cancellationDate) && + Objects.equals(this.centerJurisdiction, gstinResponseSchema.centerJurisdiction) && + Objects.equals(this.constitutionOfBusiness, gstinResponseSchema.constitutionOfBusiness) && + Objects.equals(this.dateOfRegistration, gstinResponseSchema.dateOfRegistration) && + Objects.equals(this.gstInStatus, gstinResponseSchema.gstInStatus) && + Objects.equals(this.lastUpdateDate, gstinResponseSchema.lastUpdateDate) && + Objects.equals(this.legalNameOfBusiness, gstinResponseSchema.legalNameOfBusiness) && + Objects.equals(this.message, gstinResponseSchema.message) && + Objects.equals(this.natureOfBusinessActivities, gstinResponseSchema.natureOfBusinessActivities) && + Objects.equals(this.principalPlaceAddress, gstinResponseSchema.principalPlaceAddress) && + Objects.equals(this.referenceId, gstinResponseSchema.referenceId) && + Objects.equals(this.stateJurisdiction, gstinResponseSchema.stateJurisdiction) && + Objects.equals(this.statusCode, gstinResponseSchema.statusCode) && + Objects.equals(this.taxpayerType, gstinResponseSchema.taxpayerType) && + Objects.equals(this.valid, gstinResponseSchema.valid); + } + + @Override + public int hashCode() { + return Objects.hash(GSTIN, additionalAddressArray, cancellationDate, centerJurisdiction, constitutionOfBusiness, dateOfRegistration, gstInStatus, lastUpdateDate, legalNameOfBusiness, message, natureOfBusinessActivities, principalPlaceAddress, referenceId, stateJurisdiction, statusCode, taxpayerType, valid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GstinResponseSchema {\n"); + sb.append(" GSTIN: ").append(toIndentedString(GSTIN)).append("\n"); + sb.append(" additionalAddressArray: ").append(toIndentedString(additionalAddressArray)).append("\n"); + sb.append(" cancellationDate: ").append(toIndentedString(cancellationDate)).append("\n"); + sb.append(" centerJurisdiction: ").append(toIndentedString(centerJurisdiction)).append("\n"); + sb.append(" constitutionOfBusiness: ").append(toIndentedString(constitutionOfBusiness)).append("\n"); + sb.append(" dateOfRegistration: ").append(toIndentedString(dateOfRegistration)).append("\n"); + sb.append(" gstInStatus: ").append(toIndentedString(gstInStatus)).append("\n"); + sb.append(" lastUpdateDate: ").append(toIndentedString(lastUpdateDate)).append("\n"); + sb.append(" legalNameOfBusiness: ").append(toIndentedString(legalNameOfBusiness)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" natureOfBusinessActivities: ").append(toIndentedString(natureOfBusinessActivities)).append("\n"); + sb.append(" principalPlaceAddress: ").append(toIndentedString(principalPlaceAddress)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" stateJurisdiction: ").append(toIndentedString(stateJurisdiction)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" taxpayerType: ").append(toIndentedString(taxpayerType)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("GSTIN"); + openapiFields.add("additional_address_array"); + openapiFields.add("cancellation_date"); + openapiFields.add("center_jurisdiction"); + openapiFields.add("constitution_of_business"); + openapiFields.add("date_of_registration"); + openapiFields.add("gst_in_status"); + openapiFields.add("last_update_date"); + openapiFields.add("legal_name_of_business"); + openapiFields.add("message"); + openapiFields.add("nature_of_business_activities"); + openapiFields.add("principal_place_address"); + openapiFields.add("reference_id"); + openapiFields.add("state_jurisdiction"); + openapiFields.add("status_code"); + openapiFields.add("taxpayer_type"); + openapiFields.add("valid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 GstinResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("GSTIN") != null && !jsonObj.get("GSTIN").isJsonNull()) && !jsonObj.get("GSTIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GSTIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GSTIN").toString())); + } + if (jsonObj.get("additional_address_array") != null && !jsonObj.get("additional_address_array").isJsonNull()) { + JsonArray jsonArrayadditionalAddressArray = jsonObj.getAsJsonArray("additional_address_array"); + if (jsonArrayadditionalAddressArray != null) { + // ensure the json data is an array + if (!jsonObj.get("additional_address_array").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `additional_address_array` to be an array in the JSON string but got `%s`", jsonObj.get("additional_address_array").toString())); + } + + // validate the optional field `additional_address_array` (array) + for (int i = 0; i < jsonArrayadditionalAddressArray.size(); i++) { + GstinResponseSchemaAdditionalAddressArrayInner.validateJsonElement(jsonArrayadditionalAddressArray.get(i)); + }; + } + } + if ((jsonObj.get("cancellation_date") != null && !jsonObj.get("cancellation_date").isJsonNull()) && !jsonObj.get("cancellation_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cancellation_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cancellation_date").toString())); + } + if ((jsonObj.get("center_jurisdiction") != null && !jsonObj.get("center_jurisdiction").isJsonNull()) && !jsonObj.get("center_jurisdiction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `center_jurisdiction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("center_jurisdiction").toString())); + } + if ((jsonObj.get("constitution_of_business") != null && !jsonObj.get("constitution_of_business").isJsonNull()) && !jsonObj.get("constitution_of_business").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `constitution_of_business` to be a primitive type in the JSON string but got `%s`", jsonObj.get("constitution_of_business").toString())); + } + if ((jsonObj.get("date_of_registration") != null && !jsonObj.get("date_of_registration").isJsonNull()) && !jsonObj.get("date_of_registration").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `date_of_registration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_of_registration").toString())); + } + if ((jsonObj.get("gst_in_status") != null && !jsonObj.get("gst_in_status").isJsonNull()) && !jsonObj.get("gst_in_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gst_in_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gst_in_status").toString())); + } + if ((jsonObj.get("last_update_date") != null && !jsonObj.get("last_update_date").isJsonNull()) && !jsonObj.get("last_update_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `last_update_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_update_date").toString())); + } + if ((jsonObj.get("legal_name_of_business") != null && !jsonObj.get("legal_name_of_business").isJsonNull()) && !jsonObj.get("legal_name_of_business").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `legal_name_of_business` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legal_name_of_business").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("nature_of_business_activities") != null && !jsonObj.get("nature_of_business_activities").isJsonNull() && !jsonObj.get("nature_of_business_activities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nature_of_business_activities` to be an array in the JSON string but got `%s`", jsonObj.get("nature_of_business_activities").toString())); + } + if ((jsonObj.get("principal_place_address") != null && !jsonObj.get("principal_place_address").isJsonNull()) && !jsonObj.get("principal_place_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `principal_place_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("principal_place_address").toString())); + } + if ((jsonObj.get("state_jurisdiction") != null && !jsonObj.get("state_jurisdiction").isJsonNull()) && !jsonObj.get("state_jurisdiction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state_jurisdiction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state_jurisdiction").toString())); + } + if ((jsonObj.get("status_code") != null && !jsonObj.get("status_code").isJsonNull()) && !jsonObj.get("status_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status_code").toString())); + } + if ((jsonObj.get("taxpayer_type") != null && !jsonObj.get("taxpayer_type").isJsonNull()) && !jsonObj.get("taxpayer_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `taxpayer_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxpayer_type").toString())); + } + } + + + /** + * 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 GstinResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("GSTIN") != null && !jsonObj.get("GSTIN").isJsonNull()) && !jsonObj.get("GSTIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GSTIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GSTIN").toString())); + } + if (jsonObj.get("additional_address_array") != null && !jsonObj.get("additional_address_array").isJsonNull()) { + JsonArray jsonArrayadditionalAddressArray = jsonObj.getAsJsonArray("additional_address_array"); + if (jsonArrayadditionalAddressArray != null) { + // ensure the json data is an array + if (!jsonObj.get("additional_address_array").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `additional_address_array` to be an array in the JSON string but got `%s`", jsonObj.get("additional_address_array").toString())); + } + + // validate the optional field `additional_address_array` (array) + for (int i = 0; i < jsonArrayadditionalAddressArray.size(); i++) { + GstinResponseSchemaAdditionalAddressArrayInner.validateJsonElement(jsonArrayadditionalAddressArray.get(i)); + }; + } + } + if ((jsonObj.get("cancellation_date") != null && !jsonObj.get("cancellation_date").isJsonNull()) && !jsonObj.get("cancellation_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cancellation_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cancellation_date").toString())); + } + if ((jsonObj.get("center_jurisdiction") != null && !jsonObj.get("center_jurisdiction").isJsonNull()) && !jsonObj.get("center_jurisdiction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `center_jurisdiction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("center_jurisdiction").toString())); + } + if ((jsonObj.get("constitution_of_business") != null && !jsonObj.get("constitution_of_business").isJsonNull()) && !jsonObj.get("constitution_of_business").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `constitution_of_business` to be a primitive type in the JSON string but got `%s`", jsonObj.get("constitution_of_business").toString())); + } + if ((jsonObj.get("date_of_registration") != null && !jsonObj.get("date_of_registration").isJsonNull()) && !jsonObj.get("date_of_registration").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `date_of_registration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_of_registration").toString())); + } + if ((jsonObj.get("gst_in_status") != null && !jsonObj.get("gst_in_status").isJsonNull()) && !jsonObj.get("gst_in_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gst_in_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gst_in_status").toString())); + } + if ((jsonObj.get("last_update_date") != null && !jsonObj.get("last_update_date").isJsonNull()) && !jsonObj.get("last_update_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `last_update_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_update_date").toString())); + } + if ((jsonObj.get("legal_name_of_business") != null && !jsonObj.get("legal_name_of_business").isJsonNull()) && !jsonObj.get("legal_name_of_business").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `legal_name_of_business` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legal_name_of_business").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("nature_of_business_activities") != null && !jsonObj.get("nature_of_business_activities").isJsonNull() && !jsonObj.get("nature_of_business_activities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nature_of_business_activities` to be an array in the JSON string but got `%s`", jsonObj.get("nature_of_business_activities").toString())); + } + if ((jsonObj.get("principal_place_address") != null && !jsonObj.get("principal_place_address").isJsonNull()) && !jsonObj.get("principal_place_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `principal_place_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("principal_place_address").toString())); + } + if ((jsonObj.get("state_jurisdiction") != null && !jsonObj.get("state_jurisdiction").isJsonNull()) && !jsonObj.get("state_jurisdiction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state_jurisdiction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state_jurisdiction").toString())); + } + if ((jsonObj.get("status_code") != null && !jsonObj.get("status_code").isJsonNull()) && !jsonObj.get("status_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status_code").toString())); + } + if ((jsonObj.get("taxpayer_type") != null && !jsonObj.get("taxpayer_type").isJsonNull()) && !jsonObj.get("taxpayer_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `taxpayer_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxpayer_type").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GstinResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GstinResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GstinResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GstinResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GstinResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GstinResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of GstinResponseSchema + * @throws IOException if the JSON string is invalid with respect to GstinResponseSchema + */ + public static GstinResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GstinResponseSchema.class); + } + + /** + * Convert an instance of GstinResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/GstinResponseSchemaAdditionalAddressArrayInner.java b/src/main/java/com/cashfree/model/GstinResponseSchemaAdditionalAddressArrayInner.java new file mode 100644 index 0000000..8216a5e --- /dev/null +++ b/src/main/java/com/cashfree/model/GstinResponseSchemaAdditionalAddressArrayInner.java @@ -0,0 +1,215 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * GstinResponseSchemaAdditionalAddressArrayInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class GstinResponseSchemaAdditionalAddressArrayInner { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public GstinResponseSchemaAdditionalAddressArrayInner() { + } + + public GstinResponseSchemaAdditionalAddressArrayInner address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + @Schema(example = "Koramangala", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GstinResponseSchemaAdditionalAddressArrayInner gstinResponseSchemaAdditionalAddressArrayInner = (GstinResponseSchemaAdditionalAddressArrayInner) o; + return Objects.equals(this.address, gstinResponseSchemaAdditionalAddressArrayInner.address); + } + + @Override + public int hashCode() { + return Objects.hash(address); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GstinResponseSchemaAdditionalAddressArrayInner {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 GstinResponseSchemaAdditionalAddressArrayInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + } + + + /** + * 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 GstinResponseSchemaAdditionalAddressArrayInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GstinResponseSchemaAdditionalAddressArrayInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GstinResponseSchemaAdditionalAddressArrayInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GstinResponseSchemaAdditionalAddressArrayInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GstinResponseSchemaAdditionalAddressArrayInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GstinResponseSchemaAdditionalAddressArrayInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GstinResponseSchemaAdditionalAddressArrayInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GstinResponseSchemaAdditionalAddressArrayInner + * @throws IOException if the JSON string is invalid with respect to GstinResponseSchemaAdditionalAddressArrayInner + */ + public static GstinResponseSchemaAdditionalAddressArrayInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GstinResponseSchemaAdditionalAddressArrayInner.class); + } + + /** + * Convert an instance of GstinResponseSchemaAdditionalAddressArrayInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/InvalidIpAddress.java b/src/main/java/com/cashfree/model/InvalidIpAddress.java new file mode 100644 index 0000000..151fb15 --- /dev/null +++ b/src/main/java/com/cashfree/model/InvalidIpAddress.java @@ -0,0 +1,286 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * 400 response for invalid IP address + */ +@Schema(description = "400 response for invalid IP address") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class InvalidIpAddress { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public InvalidIpAddress() { + } + + public InvalidIpAddress type(String type) { + + this.type = type; + return this; + } + + /** + * It displays the type of error. + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "validation_error", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of error.") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public InvalidIpAddress code(String code) { + + this.code = code; + return this; + } + + /** + * It displays the outcome or status of the API request. + * @return code + **/ + @javax.annotation.Nullable + @Schema(example = "invalid_ip_address", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the outcome or status of the API request.") + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public InvalidIpAddress message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "please enter a valid IP address", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvalidIpAddress invalidIpAddress = (InvalidIpAddress) o; + return Objects.equals(this.type, invalidIpAddress.type) && + Objects.equals(this.code, invalidIpAddress.code) && + Objects.equals(this.message, invalidIpAddress.message); + } + + @Override + public int hashCode() { + return Objects.hash(type, code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvalidIpAddress {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("code"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 InvalidIpAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 InvalidIpAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvalidIpAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvalidIpAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvalidIpAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvalidIpAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvalidIpAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvalidIpAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvalidIpAddress + * @throws IOException if the JSON string is invalid with respect to InvalidIpAddress + */ + public static InvalidIpAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvalidIpAddress.class); + } + + /** + * Convert an instance of InvalidIpAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/Invaliddoctypeschema.java b/src/main/java/com/cashfree/model/Invaliddoctypeschema.java new file mode 100644 index 0000000..91b1faa --- /dev/null +++ b/src/main/java/com/cashfree/model/Invaliddoctypeschema.java @@ -0,0 +1,315 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Invalid document type response + */ +@Schema(description = "Invalid document type response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class Invaliddoctypeschema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public Invaliddoctypeschema() { + } + + public Invaliddoctypeschema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the document type. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "INVALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the document type.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public Invaliddoctypeschema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "35476", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public Invaliddoctypeschema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public Invaliddoctypeschema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "Document type not supported", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Invaliddoctypeschema invaliddoctypeschema = (Invaliddoctypeschema) o; + return Objects.equals(this.status, invaliddoctypeschema.status) && + Objects.equals(this.referenceId, invaliddoctypeschema.referenceId) && + Objects.equals(this.verificationId, invaliddoctypeschema.verificationId) && + Objects.equals(this.message, invaliddoctypeschema.message); + } + + @Override + public int hashCode() { + return Objects.hash(status, referenceId, verificationId, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Invaliddoctypeschema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 Invaliddoctypeschema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 Invaliddoctypeschema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Invaliddoctypeschema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Invaliddoctypeschema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Invaliddoctypeschema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Invaliddoctypeschema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Invaliddoctypeschema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Invaliddoctypeschema given an JSON string + * + * @param jsonString JSON string + * @return An instance of Invaliddoctypeschema + * @throws IOException if the JSON string is invalid with respect to Invaliddoctypeschema + */ + public static Invaliddoctypeschema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Invaliddoctypeschema.class); + } + + /** + * Convert an instance of Invaliddoctypeschema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/IpVerificationRequestSchema.java b/src/main/java/com/cashfree/model/IpVerificationRequestSchema.java new file mode 100644 index 0000000..2851f19 --- /dev/null +++ b/src/main/java/com/cashfree/model/IpVerificationRequestSchema.java @@ -0,0 +1,267 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify IP address + */ +@Schema(description = "Find the request parameters to verify IP address") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class IpVerificationRequestSchema { + public static final String SERIALIZED_NAME_IP_ADDRESS = "ip_address"; + @SerializedName(SERIALIZED_NAME_IP_ADDRESS) + private String ipAddress = "1.0.171.255"; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "testverificationid"; + + public IpVerificationRequestSchema() { + } + + public IpVerificationRequestSchema ipAddress(String ipAddress) { + + this.ipAddress = ipAddress; + return this; + } + + /** + * It is the IP address that you need to verify which is assigned to a device connected to a computer network. + * @return ipAddress + **/ + @javax.annotation.Nonnull + @Schema(example = "1.0.171.255", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the IP address that you need to verify which is assigned to a device connected to a computer network.") + public String getIpAddress() { + return ipAddress; + } + + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + + public IpVerificationRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IpVerificationRequestSchema ipVerificationRequestSchema = (IpVerificationRequestSchema) o; + return Objects.equals(this.ipAddress, ipVerificationRequestSchema.ipAddress) && + Objects.equals(this.verificationId, ipVerificationRequestSchema.verificationId); + } + + @Override + public int hashCode() { + return Objects.hash(ipAddress, verificationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IpVerificationRequestSchema {\n"); + sb.append(" ipAddress: ").append(toIndentedString(ipAddress)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ip_address"); + openapiFields.add("verification_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ip_address"); + openapiRequiredFields.add("verification_id"); + } + + /** + * 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 IpVerificationRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IpVerificationRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ip_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip_address").toString())); + } + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 IpVerificationRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IpVerificationRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ip_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip_address").toString())); + } + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IpVerificationRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IpVerificationRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IpVerificationRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IpVerificationRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IpVerificationRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IpVerificationRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of IpVerificationRequestSchema + * @throws IOException if the JSON string is invalid with respect to IpVerificationRequestSchema + */ + public static IpVerificationRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IpVerificationRequestSchema.class); + } + + /** + * Convert an instance of IpVerificationRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/IpVerificationResponseSchema.java b/src/main/java/com/cashfree/model/IpVerificationResponseSchema.java new file mode 100644 index 0000000..7b5326b --- /dev/null +++ b/src/main/java/com/cashfree/model/IpVerificationResponseSchema.java @@ -0,0 +1,560 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Verify IP success response + */ +@Schema(description = "Verify IP success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class IpVerificationResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_IP_ADDRESS = "ip_address"; + @SerializedName(SERIALIZED_NAME_IP_ADDRESS) + private String ipAddress; + + public static final String SERIALIZED_NAME_PROXY_TYPE = "proxy_type"; + @SerializedName(SERIALIZED_NAME_PROXY_TYPE) + private String proxyType; + + public static final String SERIALIZED_NAME_COUNTRY_CODE = "country_code"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + private String countryCode; + + public static final String SERIALIZED_NAME_COUNTRY_NAME = "country_name"; + @SerializedName(SERIALIZED_NAME_COUNTRY_NAME) + private String countryName; + + public static final String SERIALIZED_NAME_REGION_NAME = "region_name"; + @SerializedName(SERIALIZED_NAME_REGION_NAME) + private String regionName; + + public static final String SERIALIZED_NAME_CITY_NAME = "city_name"; + @SerializedName(SERIALIZED_NAME_CITY_NAME) + private String cityName; + + public static final String SERIALIZED_NAME_CITY_RISK_SCORE = "city_risk_score"; + @SerializedName(SERIALIZED_NAME_CITY_RISK_SCORE) + private String cityRiskScore; + + public static final String SERIALIZED_NAME_PROXY_TYPE_RISK_SCORE = "proxy_type_risk_score"; + @SerializedName(SERIALIZED_NAME_PROXY_TYPE_RISK_SCORE) + private String proxyTypeRiskScore; + + public IpVerificationResponseSchema() { + } + + public IpVerificationResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public IpVerificationResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public IpVerificationResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the IP address. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the IP address.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public IpVerificationResponseSchema ipAddress(String ipAddress) { + + this.ipAddress = ipAddress; + return this; + } + + /** + * It displays the entered IP address. + * @return ipAddress + **/ + @javax.annotation.Nullable + @Schema(example = "1.0.171.255", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the entered IP address.") + public String getIpAddress() { + return ipAddress; + } + + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + + public IpVerificationResponseSchema proxyType(String proxyType) { + + this.proxyType = proxyType; + return this; + } + + /** + * It displays the category or classification of a proxy server based on its functionality and how it handles network requests. + * @return proxyType + **/ + @javax.annotation.Nullable + @Schema(example = "VPA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the category or classification of a proxy server based on its functionality and how it handles network requests.") + public String getProxyType() { + return proxyType; + } + + + public void setProxyType(String proxyType) { + this.proxyType = proxyType; + } + + + public IpVerificationResponseSchema countryCode(String countryCode) { + + this.countryCode = countryCode; + return this; + } + + /** + * It displays the country code associated with the geographical location of the device or network to which the IP address is assigned. + * @return countryCode + **/ + @javax.annotation.Nullable + @Schema(example = "TH", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the country code associated with the geographical location of the device or network to which the IP address is assigned.") + public String getCountryCode() { + return countryCode; + } + + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + + public IpVerificationResponseSchema countryName(String countryName) { + + this.countryName = countryName; + return this; + } + + /** + * It displays the name of the country associated with the geographical location of the device or network to which the IP address is assigned. + * @return countryName + **/ + @javax.annotation.Nullable + @Schema(example = "Thailand", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the country associated with the geographical location of the device or network to which the IP address is assigned.") + public String getCountryName() { + return countryName; + } + + + public void setCountryName(String countryName) { + this.countryName = countryName; + } + + + public IpVerificationResponseSchema regionName(String regionName) { + + this.regionName = regionName; + return this; + } + + /** + * It displays the name of the region associated with the geographical location of the device or network to which the IP address is assigned. + * @return regionName + **/ + @javax.annotation.Nullable + @Schema(example = "Phangnga", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the region associated with the geographical location of the device or network to which the IP address is assigned.") + public String getRegionName() { + return regionName; + } + + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + + public IpVerificationResponseSchema cityName(String cityName) { + + this.cityName = cityName; + return this; + } + + /** + * It displays the name of the city associated with the geographical location of the device or network to which the IP address is assigned. + * @return cityName + **/ + @javax.annotation.Nullable + @Schema(example = "Phang Nga", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the city associated with the geographical location of the device or network to which the IP address is assigned.") + public String getCityName() { + return cityName; + } + + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + + public IpVerificationResponseSchema cityRiskScore(String cityRiskScore) { + + this.cityRiskScore = cityRiskScore; + return this; + } + + /** + * It displays the risk score associated with a particular city based on factors such as cybersecurity threats, crime rates, or other relevant data. + * @return cityRiskScore + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the risk score associated with a particular city based on factors such as cybersecurity threats, crime rates, or other relevant data.") + public String getCityRiskScore() { + return cityRiskScore; + } + + + public void setCityRiskScore(String cityRiskScore) { + this.cityRiskScore = cityRiskScore; + } + + + public IpVerificationResponseSchema proxyTypeRiskScore(String proxyTypeRiskScore) { + + this.proxyTypeRiskScore = proxyTypeRiskScore; + return this; + } + + /** + * It displays the risk score associated with a particular city based on factors such as cybersecurity threats, crime rates, or other relevant data. + * @return proxyTypeRiskScore + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the risk score associated with a particular city based on factors such as cybersecurity threats, crime rates, or other relevant data.") + public String getProxyTypeRiskScore() { + return proxyTypeRiskScore; + } + + + public void setProxyTypeRiskScore(String proxyTypeRiskScore) { + this.proxyTypeRiskScore = proxyTypeRiskScore; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IpVerificationResponseSchema ipVerificationResponseSchema = (IpVerificationResponseSchema) o; + return Objects.equals(this.referenceId, ipVerificationResponseSchema.referenceId) && + Objects.equals(this.verificationId, ipVerificationResponseSchema.verificationId) && + Objects.equals(this.status, ipVerificationResponseSchema.status) && + Objects.equals(this.ipAddress, ipVerificationResponseSchema.ipAddress) && + Objects.equals(this.proxyType, ipVerificationResponseSchema.proxyType) && + Objects.equals(this.countryCode, ipVerificationResponseSchema.countryCode) && + Objects.equals(this.countryName, ipVerificationResponseSchema.countryName) && + Objects.equals(this.regionName, ipVerificationResponseSchema.regionName) && + Objects.equals(this.cityName, ipVerificationResponseSchema.cityName) && + Objects.equals(this.cityRiskScore, ipVerificationResponseSchema.cityRiskScore) && + Objects.equals(this.proxyTypeRiskScore, ipVerificationResponseSchema.proxyTypeRiskScore); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, status, ipAddress, proxyType, countryCode, countryName, regionName, cityName, cityRiskScore, proxyTypeRiskScore); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IpVerificationResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" ipAddress: ").append(toIndentedString(ipAddress)).append("\n"); + sb.append(" proxyType: ").append(toIndentedString(proxyType)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" countryName: ").append(toIndentedString(countryName)).append("\n"); + sb.append(" regionName: ").append(toIndentedString(regionName)).append("\n"); + sb.append(" cityName: ").append(toIndentedString(cityName)).append("\n"); + sb.append(" cityRiskScore: ").append(toIndentedString(cityRiskScore)).append("\n"); + sb.append(" proxyTypeRiskScore: ").append(toIndentedString(proxyTypeRiskScore)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("status"); + openapiFields.add("ip_address"); + openapiFields.add("proxy_type"); + openapiFields.add("country_code"); + openapiFields.add("country_name"); + openapiFields.add("region_name"); + openapiFields.add("city_name"); + openapiFields.add("city_risk_score"); + openapiFields.add("proxy_type_risk_score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 IpVerificationResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("ip_address") != null && !jsonObj.get("ip_address").isJsonNull()) && !jsonObj.get("ip_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip_address").toString())); + } + if ((jsonObj.get("proxy_type") != null && !jsonObj.get("proxy_type").isJsonNull()) && !jsonObj.get("proxy_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `proxy_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxy_type").toString())); + } + if ((jsonObj.get("country_code") != null && !jsonObj.get("country_code").isJsonNull()) && !jsonObj.get("country_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_code").toString())); + } + if ((jsonObj.get("country_name") != null && !jsonObj.get("country_name").isJsonNull()) && !jsonObj.get("country_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_name").toString())); + } + if ((jsonObj.get("region_name") != null && !jsonObj.get("region_name").isJsonNull()) && !jsonObj.get("region_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `region_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region_name").toString())); + } + if ((jsonObj.get("city_name") != null && !jsonObj.get("city_name").isJsonNull()) && !jsonObj.get("city_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city_name").toString())); + } + if ((jsonObj.get("city_risk_score") != null && !jsonObj.get("city_risk_score").isJsonNull()) && !jsonObj.get("city_risk_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city_risk_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city_risk_score").toString())); + } + if ((jsonObj.get("proxy_type_risk_score") != null && !jsonObj.get("proxy_type_risk_score").isJsonNull()) && !jsonObj.get("proxy_type_risk_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `proxy_type_risk_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxy_type_risk_score").toString())); + } + } + + + /** + * 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 IpVerificationResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("ip_address") != null && !jsonObj.get("ip_address").isJsonNull()) && !jsonObj.get("ip_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ip_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip_address").toString())); + } + if ((jsonObj.get("proxy_type") != null && !jsonObj.get("proxy_type").isJsonNull()) && !jsonObj.get("proxy_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `proxy_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxy_type").toString())); + } + if ((jsonObj.get("country_code") != null && !jsonObj.get("country_code").isJsonNull()) && !jsonObj.get("country_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_code").toString())); + } + if ((jsonObj.get("country_name") != null && !jsonObj.get("country_name").isJsonNull()) && !jsonObj.get("country_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_name").toString())); + } + if ((jsonObj.get("region_name") != null && !jsonObj.get("region_name").isJsonNull()) && !jsonObj.get("region_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `region_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region_name").toString())); + } + if ((jsonObj.get("city_name") != null && !jsonObj.get("city_name").isJsonNull()) && !jsonObj.get("city_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city_name").toString())); + } + if ((jsonObj.get("city_risk_score") != null && !jsonObj.get("city_risk_score").isJsonNull()) && !jsonObj.get("city_risk_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city_risk_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city_risk_score").toString())); + } + if ((jsonObj.get("proxy_type_risk_score") != null && !jsonObj.get("proxy_type_risk_score").isJsonNull()) && !jsonObj.get("proxy_type_risk_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `proxy_type_risk_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxy_type_risk_score").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IpVerificationResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IpVerificationResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IpVerificationResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IpVerificationResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IpVerificationResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IpVerificationResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of IpVerificationResponseSchema + * @throws IOException if the JSON string is invalid with respect to IpVerificationResponseSchema + */ + public static IpVerificationResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IpVerificationResponseSchema.class); + } + + /** + * Convert an instance of IpVerificationResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/LivelinessRequestSchema.java b/src/main/java/com/cashfree/model/LivelinessRequestSchema.java new file mode 100644 index 0000000..6c6d954 --- /dev/null +++ b/src/main/java/com/cashfree/model/LivelinessRequestSchema.java @@ -0,0 +1,291 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to check the liveliness in an image + */ +@Schema(description = "Find the request parameters to check the liveliness in an image") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class LivelinessRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "123"; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) + private File image; + + public static final String SERIALIZED_NAME_STRICT_CHECK = "strict_check"; + @SerializedName(SERIALIZED_NAME_STRICT_CHECK) + private Boolean strictCheck; + + public LivelinessRequestSchema() { + } + + public LivelinessRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public LivelinessRequestSchema image(File image) { + + this.image = image; + return this; + } + + /** + * Upload the image of the individual to verify the liveliness of the image. + * @return image + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@57bfca3a", requiredMode = Schema.RequiredMode.REQUIRED, description = "Upload the image of the individual to verify the liveliness of the image.") + public File getImage() { + return image; + } + + + public void setImage(File image) { + this.image = image; + } + + + public LivelinessRequestSchema strictCheck(Boolean strictCheck) { + + this.strictCheck = strictCheck; + return this; + } + + /** + * It is the boolean value to set the strictness check of the image. Default value for strict_check is false. + * @return strictCheck + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the boolean value to set the strictness check of the image. Default value for strict_check is false.") + public Boolean getStrictCheck() { + return strictCheck; + } + + + public void setStrictCheck(Boolean strictCheck) { + this.strictCheck = strictCheck; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LivelinessRequestSchema livelinessRequestSchema = (LivelinessRequestSchema) o; + return Objects.equals(this.verificationId, livelinessRequestSchema.verificationId) && + Objects.equals(this.image, livelinessRequestSchema.image) && + Objects.equals(this.strictCheck, livelinessRequestSchema.strictCheck); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, image, strictCheck); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LivelinessRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" strictCheck: ").append(toIndentedString(strictCheck)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("image"); + openapiFields.add("strict_check"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("image"); + } + + /** + * 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 LivelinessRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LivelinessRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 LivelinessRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LivelinessRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LivelinessRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LivelinessRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LivelinessRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LivelinessRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LivelinessRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LivelinessRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of LivelinessRequestSchema + * @throws IOException if the JSON string is invalid with respect to LivelinessRequestSchema + */ + public static LivelinessRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LivelinessRequestSchema.class); + } + + /** + * Convert an instance of LivelinessRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/LivelinessResponseSchema.java b/src/main/java/com/cashfree/model/LivelinessResponseSchema.java new file mode 100644 index 0000000..136280f --- /dev/null +++ b/src/main/java/com/cashfree/model/LivelinessResponseSchema.java @@ -0,0 +1,340 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Liveliness Check API + */ +@Schema(description = "Success response for Liveliness Check API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class LivelinessResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_LIVELINESS = "liveliness"; + @SerializedName(SERIALIZED_NAME_LIVELINESS) + private Boolean liveliness; + + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + private Float score; + + public LivelinessResponseSchema() { + } + + public LivelinessResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1357", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public LivelinessResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "123456789", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public LivelinessResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public LivelinessResponseSchema liveliness(Boolean liveliness) { + + this.liveliness = liveliness; + return this; + } + + /** + * It displays the result of the liveliness check. + * @return liveliness + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the result of the liveliness check.") + public Boolean getLiveliness() { + return liveliness; + } + + + public void setLiveliness(Boolean liveliness) { + this.liveliness = liveliness; + } + + + public LivelinessResponseSchema score(Float score) { + + this.score = score; + return this; + } + + /** + * It displays the score of the liveliness check. + * minimum: 0 + * maximum: 1 + * @return score + **/ + @javax.annotation.Nullable + @Schema(example = "0.95", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score of the liveliness check.") + public Float getScore() { + return score; + } + + + public void setScore(Float score) { + this.score = score; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LivelinessResponseSchema livelinessResponseSchema = (LivelinessResponseSchema) o; + return Objects.equals(this.referenceId, livelinessResponseSchema.referenceId) && + Objects.equals(this.verificationId, livelinessResponseSchema.verificationId) && + Objects.equals(this.status, livelinessResponseSchema.status) && + Objects.equals(this.liveliness, livelinessResponseSchema.liveliness) && + Objects.equals(this.score, livelinessResponseSchema.score); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, status, liveliness, score); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LivelinessResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" liveliness: ").append(toIndentedString(liveliness)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("status"); + openapiFields.add("liveliness"); + openapiFields.add("score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 LivelinessResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + + /** + * 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 LivelinessResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LivelinessResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LivelinessResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LivelinessResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LivelinessResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LivelinessResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LivelinessResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of LivelinessResponseSchema + * @throws IOException if the JSON string is invalid with respect to LivelinessResponseSchema + */ + public static LivelinessResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LivelinessResponseSchema.class); + } + + /** + * Convert an instance of LivelinessResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/NameMatchRequestSchema.java b/src/main/java/com/cashfree/model/NameMatchRequestSchema.java new file mode 100644 index 0000000..f13879e --- /dev/null +++ b/src/main/java/com/cashfree/model/NameMatchRequestSchema.java @@ -0,0 +1,303 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters for the Name Match API + */ +@Schema(description = "Find the request parameters for the Name Match API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class NameMatchRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "ABC00123"; + + public static final String SERIALIZED_NAME_NAME1 = "name_1"; + @SerializedName(SERIALIZED_NAME_NAME1) + private String name1 = "JOHN DOE"; + + public static final String SERIALIZED_NAME_NAME2 = "name_2"; + @SerializedName(SERIALIZED_NAME_NAME2) + private String name2 = "JOHN DOE"; + + public NameMatchRequestSchema() { + } + + public NameMatchRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you need to create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you need to create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-) and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public NameMatchRequestSchema name1(String name1) { + + this.name1 = name1; + return this; + } + + /** + * It is the name you want to verify. + * @return name1 + **/ + @javax.annotation.Nonnull + @Schema(example = "JOHN DOE", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the name you want to verify.") + public String getName1() { + return name1; + } + + + public void setName1(String name1) { + this.name1 = name1; + } + + + public NameMatchRequestSchema name2(String name2) { + + this.name2 = name2; + return this; + } + + /** + * It is the name you want to verify with name_1. + * @return name2 + **/ + @javax.annotation.Nonnull + @Schema(example = "JOHN DOE", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the name you want to verify with name_1.") + public String getName2() { + return name2; + } + + + public void setName2(String name2) { + this.name2 = name2; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameMatchRequestSchema nameMatchRequestSchema = (NameMatchRequestSchema) o; + return Objects.equals(this.verificationId, nameMatchRequestSchema.verificationId) && + Objects.equals(this.name1, nameMatchRequestSchema.name1) && + Objects.equals(this.name2, nameMatchRequestSchema.name2); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, name1, name2); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameMatchRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" name1: ").append(toIndentedString(name1)).append("\n"); + sb.append(" name2: ").append(toIndentedString(name2)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("name_1"); + openapiFields.add("name_2"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("name_1"); + openapiRequiredFields.add("name_2"); + } + + /** + * 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 NameMatchRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NameMatchRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("name_1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_1").toString())); + } + if (!jsonObj.get("name_2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_2").toString())); + } + } + + + /** + * 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 NameMatchRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NameMatchRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("name_1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_1").toString())); + } + if (!jsonObj.get("name_2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_2").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NameMatchRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NameMatchRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NameMatchRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NameMatchRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NameMatchRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NameMatchRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of NameMatchRequestSchema + * @throws IOException if the JSON string is invalid with respect to NameMatchRequestSchema + */ + public static NameMatchRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NameMatchRequestSchema.class); + } + + /** + * Convert an instance of NameMatchRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/NameMatchResponseSchema.java b/src/main/java/com/cashfree/model/NameMatchResponseSchema.java new file mode 100644 index 0000000..25746f0 --- /dev/null +++ b/src/main/java/com/cashfree/model/NameMatchResponseSchema.java @@ -0,0 +1,415 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Name Match API + */ +@Schema(description = "Success response for Name Match API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class NameMatchResponseSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_NAME1 = "name_1"; + @SerializedName(SERIALIZED_NAME_NAME1) + private String name1; + + public static final String SERIALIZED_NAME_NAME2 = "name_2"; + @SerializedName(SERIALIZED_NAME_NAME2) + private String name2; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + private BigDecimal score; + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + public NameMatchResponseSchema() { + } + + public NameMatchResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public NameMatchResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public NameMatchResponseSchema name1(String name1) { + + this.name1 = name1; + return this; + } + + /** + * It displays the name you entered for verification. + * @return name1 + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name you entered for verification.") + public String getName1() { + return name1; + } + + + public void setName1(String name1) { + this.name1 = name1; + } + + + public NameMatchResponseSchema name2(String name2) { + + this.name2 = name2; + return this; + } + + /** + * It displays the name you entered for verificaiton with name_1. + * @return name2 + **/ + @javax.annotation.Nullable + @Schema(example = "John Snow", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name you entered for verificaiton with name_1.") + public String getName2() { + return name2; + } + + + public void setName2(String name2) { + this.name2 = name2; + } + + + public NameMatchResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public NameMatchResponseSchema score(BigDecimal score) { + + this.score = score; + return this; + } + + /** + * It displays the score of the name match verification. + * @return score + **/ + @javax.annotation.Nullable + @Schema(example = "0.85", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the score of the name match verification.") + public BigDecimal getScore() { + return score; + } + + + public void setScore(BigDecimal score) { + this.score = score; + } + + + public NameMatchResponseSchema reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * It justifies the match score for the API request. + * @return reason + **/ + @javax.annotation.Nullable + @Schema(example = "The given names are identical", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It justifies the match score for the API request.") + public String getReason() { + return reason; + } + + + public void setReason(String reason) { + this.reason = reason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameMatchResponseSchema nameMatchResponseSchema = (NameMatchResponseSchema) o; + return Objects.equals(this.verificationId, nameMatchResponseSchema.verificationId) && + Objects.equals(this.referenceId, nameMatchResponseSchema.referenceId) && + Objects.equals(this.name1, nameMatchResponseSchema.name1) && + Objects.equals(this.name2, nameMatchResponseSchema.name2) && + Objects.equals(this.status, nameMatchResponseSchema.status) && + Objects.equals(this.score, nameMatchResponseSchema.score) && + Objects.equals(this.reason, nameMatchResponseSchema.reason); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, referenceId, name1, name2, status, score, reason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameMatchResponseSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" name1: ").append(toIndentedString(name1)).append("\n"); + sb.append(" name2: ").append(toIndentedString(name2)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("name_1"); + openapiFields.add("name_2"); + openapiFields.add("status"); + openapiFields.add("score"); + openapiFields.add("reason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 NameMatchResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name_1") != null && !jsonObj.get("name_1").isJsonNull()) && !jsonObj.get("name_1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_1").toString())); + } + if ((jsonObj.get("name_2") != null && !jsonObj.get("name_2").isJsonNull()) && !jsonObj.get("name_2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_2").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); + } + } + + + /** + * 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 NameMatchResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name_1") != null && !jsonObj.get("name_1").isJsonNull()) && !jsonObj.get("name_1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_1").toString())); + } + if ((jsonObj.get("name_2") != null && !jsonObj.get("name_2").isJsonNull()) && !jsonObj.get("name_2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_2").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NameMatchResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NameMatchResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NameMatchResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NameMatchResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NameMatchResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NameMatchResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of NameMatchResponseSchema + * @throws IOException if the JSON string is invalid with respect to NameMatchResponseSchema + */ + public static NameMatchResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NameMatchResponseSchema.class); + } + + /** + * Convert an instance of NameMatchResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/OfflineAadhaarSendOtpRequestSchema.java b/src/main/java/com/cashfree/model/OfflineAadhaarSendOtpRequestSchema.java new file mode 100644 index 0000000..cd7b481 --- /dev/null +++ b/src/main/java/com/cashfree/model/OfflineAadhaarSendOtpRequestSchema.java @@ -0,0 +1,231 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to generate an OTP for aadhaar verification + */ +@Schema(description = "Find the request parameters to generate an OTP for aadhaar verification") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class OfflineAadhaarSendOtpRequestSchema { + public static final String SERIALIZED_NAME_AADHAAR_NUMBER = "aadhaar_number"; + @SerializedName(SERIALIZED_NAME_AADHAAR_NUMBER) + private String aadhaarNumber = "655675523712"; + + public OfflineAadhaarSendOtpRequestSchema() { + } + + public OfflineAadhaarSendOtpRequestSchema aadhaarNumber(String aadhaarNumber) { + + this.aadhaarNumber = aadhaarNumber; + return this; + } + + /** + * It is the unique 12-digit identification number issued by the Unique Identification Authority of India (UIDAI). + * @return aadhaarNumber + **/ + @javax.annotation.Nonnull + @Schema(example = "655675523712", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique 12-digit identification number issued by the Unique Identification Authority of India (UIDAI).") + public String getAadhaarNumber() { + return aadhaarNumber; + } + + + public void setAadhaarNumber(String aadhaarNumber) { + this.aadhaarNumber = aadhaarNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OfflineAadhaarSendOtpRequestSchema offlineAadhaarSendOtpRequestSchema = (OfflineAadhaarSendOtpRequestSchema) o; + return Objects.equals(this.aadhaarNumber, offlineAadhaarSendOtpRequestSchema.aadhaarNumber); + } + + @Override + public int hashCode() { + return Objects.hash(aadhaarNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OfflineAadhaarSendOtpRequestSchema {\n"); + sb.append(" aadhaarNumber: ").append(toIndentedString(aadhaarNumber)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("aadhaar_number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("aadhaar_number"); + } + + /** + * 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 OfflineAadhaarSendOtpRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OfflineAadhaarSendOtpRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("aadhaar_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar_number").toString())); + } + } + + + /** + * 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 OfflineAadhaarSendOtpRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OfflineAadhaarSendOtpRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("aadhaar_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aadhaar_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aadhaar_number").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OfflineAadhaarSendOtpRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OfflineAadhaarSendOtpRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OfflineAadhaarSendOtpRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OfflineAadhaarSendOtpRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OfflineAadhaarSendOtpRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OfflineAadhaarSendOtpRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of OfflineAadhaarSendOtpRequestSchema + * @throws IOException if the JSON string is invalid with respect to OfflineAadhaarSendOtpRequestSchema + */ + public static OfflineAadhaarSendOtpRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OfflineAadhaarSendOtpRequestSchema.class); + } + + /** + * Convert an instance of OfflineAadhaarSendOtpRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/OfflineAadhaarSendOtpResponseSchema.java b/src/main/java/com/cashfree/model/OfflineAadhaarSendOtpResponseSchema.java new file mode 100644 index 0000000..8c1cce1 --- /dev/null +++ b/src/main/java/com/cashfree/model/OfflineAadhaarSendOtpResponseSchema.java @@ -0,0 +1,286 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Generate OTP to Verify Aadhaar API + */ +@Schema(description = "Success response for Generate OTP to Verify Aadhaar API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class OfflineAadhaarSendOtpResponseSchema { + public static final String SERIALIZED_NAME_REF_ID = "ref_id"; + @SerializedName(SERIALIZED_NAME_REF_ID) + private String refId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public OfflineAadhaarSendOtpResponseSchema() { + } + + public OfflineAadhaarSendOtpResponseSchema refId(String refId) { + + this.refId = refId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return refId + **/ + @javax.annotation.Nullable + @Schema(example = "12345", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public String getRefId() { + return refId; + } + + + public void setRefId(String refId) { + this.refId = refId; + } + + + public OfflineAadhaarSendOtpResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "INITIATED", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public OfflineAadhaarSendOtpResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "OTP send successfully.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OfflineAadhaarSendOtpResponseSchema offlineAadhaarSendOtpResponseSchema = (OfflineAadhaarSendOtpResponseSchema) o; + return Objects.equals(this.refId, offlineAadhaarSendOtpResponseSchema.refId) && + Objects.equals(this.status, offlineAadhaarSendOtpResponseSchema.status) && + Objects.equals(this.message, offlineAadhaarSendOtpResponseSchema.message); + } + + @Override + public int hashCode() { + return Objects.hash(refId, status, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OfflineAadhaarSendOtpResponseSchema {\n"); + sb.append(" refId: ").append(toIndentedString(refId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ref_id"); + openapiFields.add("status"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 OfflineAadhaarSendOtpResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ref_id") != null && !jsonObj.get("ref_id").isJsonNull()) && !jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 OfflineAadhaarSendOtpResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ref_id") != null && !jsonObj.get("ref_id").isJsonNull()) && !jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OfflineAadhaarSendOtpResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OfflineAadhaarSendOtpResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OfflineAadhaarSendOtpResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OfflineAadhaarSendOtpResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OfflineAadhaarSendOtpResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OfflineAadhaarSendOtpResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of OfflineAadhaarSendOtpResponseSchema + * @throws IOException if the JSON string is invalid with respect to OfflineAadhaarSendOtpResponseSchema + */ + public static OfflineAadhaarSendOtpResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OfflineAadhaarSendOtpResponseSchema.class); + } + + /** + * Convert an instance of OfflineAadhaarSendOtpResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpRequestSchema.java b/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpRequestSchema.java new file mode 100644 index 0000000..8ca165f --- /dev/null +++ b/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpRequestSchema.java @@ -0,0 +1,267 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to submit the OTP for aadhaar verification + */ +@Schema(description = "Find the request parameters to submit the OTP for aadhaar verification") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class OfflineAadhaarVerifyOtpRequestSchema { + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + private String otp = "267987"; + + public static final String SERIALIZED_NAME_REF_ID = "ref_id"; + @SerializedName(SERIALIZED_NAME_REF_ID) + private String refId = "21637861"; + + public OfflineAadhaarVerifyOtpRequestSchema() { + } + + public OfflineAadhaarVerifyOtpRequestSchema otp(String otp) { + + this.otp = otp; + return this; + } + + /** + * It is the OTP received on the registered phone number for offline aadhaar verification. + * @return otp + **/ + @javax.annotation.Nonnull + @Schema(example = "267987", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the OTP received on the registered phone number for offline aadhaar verification.") + public String getOtp() { + return otp; + } + + + public void setOtp(String otp) { + this.otp = otp; + } + + + public OfflineAadhaarVerifyOtpRequestSchema refId(String refId) { + + this.refId = refId; + return this; + } + + /** + * It is the unique ID created by Cashfree Payments that you receive in the response of Generate OTP to Verify Aadhaar API. + * @return refId + **/ + @javax.annotation.Nonnull + @Schema(example = "21637861", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID created by Cashfree Payments that you receive in the response of Generate OTP to Verify Aadhaar API.") + public String getRefId() { + return refId; + } + + + public void setRefId(String refId) { + this.refId = refId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OfflineAadhaarVerifyOtpRequestSchema offlineAadhaarVerifyOtpRequestSchema = (OfflineAadhaarVerifyOtpRequestSchema) o; + return Objects.equals(this.otp, offlineAadhaarVerifyOtpRequestSchema.otp) && + Objects.equals(this.refId, offlineAadhaarVerifyOtpRequestSchema.refId); + } + + @Override + public int hashCode() { + return Objects.hash(otp, refId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OfflineAadhaarVerifyOtpRequestSchema {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" refId: ").append(toIndentedString(refId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("otp"); + openapiFields.add("ref_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("ref_id"); + } + + /** + * 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 OfflineAadhaarVerifyOtpRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OfflineAadhaarVerifyOtpRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + } + + + /** + * 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 OfflineAadhaarVerifyOtpRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OfflineAadhaarVerifyOtpRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OfflineAadhaarVerifyOtpRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OfflineAadhaarVerifyOtpRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OfflineAadhaarVerifyOtpRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OfflineAadhaarVerifyOtpRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OfflineAadhaarVerifyOtpRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OfflineAadhaarVerifyOtpRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of OfflineAadhaarVerifyOtpRequestSchema + * @throws IOException if the JSON string is invalid with respect to OfflineAadhaarVerifyOtpRequestSchema + */ + public static OfflineAadhaarVerifyOtpRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OfflineAadhaarVerifyOtpRequestSchema.class); + } + + /** + * Convert an instance of OfflineAadhaarVerifyOtpRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchema.java b/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchema.java new file mode 100644 index 0000000..75e599e --- /dev/null +++ b/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchema.java @@ -0,0 +1,640 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.OfflineAadhaarVerifyOtpResponseSchemaSplitAddress; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Submit OTP for Aadhaar Verification + */ +@Schema(description = "Success response for Submit OTP for Aadhaar Verification") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class OfflineAadhaarVerifyOtpResponseSchema { + public static final String SERIALIZED_NAME_REF_ID = "ref_id"; + @SerializedName(SERIALIZED_NAME_REF_ID) + private String refId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CARE_OF = "care_of"; + @SerializedName(SERIALIZED_NAME_CARE_OF) + private String careOf; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_YEAR_OF_BIRTH = "year_of_birth"; + @SerializedName(SERIALIZED_NAME_YEAR_OF_BIRTH) + private String yearOfBirth; + + public static final String SERIALIZED_NAME_MOBILE_HASH = "mobile_hash"; + @SerializedName(SERIALIZED_NAME_MOBILE_HASH) + private String mobileHash; + + public static final String SERIALIZED_NAME_PHOTO_LINK = "photo_link"; + @SerializedName(SERIALIZED_NAME_PHOTO_LINK) + private String photoLink; + + public static final String SERIALIZED_NAME_SPLIT_ADDRESS = "split_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_ADDRESS) + private OfflineAadhaarVerifyOtpResponseSchemaSplitAddress splitAddress; + + public OfflineAadhaarVerifyOtpResponseSchema() { + } + + public OfflineAadhaarVerifyOtpResponseSchema refId(String refId) { + + this.refId = refId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return refId + **/ + @javax.annotation.Nullable + @Schema(example = "123456789", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public String getRefId() { + return refId; + } + + + public void setRefId(String refId) { + this.refId = refId; + } + + + public OfflineAadhaarVerifyOtpResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the aadhaar information. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the aadhaar information.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public OfflineAadhaarVerifyOtpResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "123456789", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public OfflineAadhaarVerifyOtpResponseSchema careOf(String careOf) { + + this.careOf = careOf; + return this; + } + + /** + * It displays the parent/guardian of the aadhaar card holder. + * @return careOf + **/ + @javax.annotation.Nullable + @Schema(example = "Jane Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the parent/guardian of the aadhaar card holder.") + public String getCareOf() { + return careOf; + } + + + public void setCareOf(String careOf) { + this.careOf = careOf; + } + + + public OfflineAadhaarVerifyOtpResponseSchema address(String address) { + + this.address = address; + return this; + } + + /** + * It displays the address information as present in the aadhaar card. + * @return address + **/ + @javax.annotation.Nullable + @Schema(example = "Chimli", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address information as present in the aadhaar card.") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public OfflineAadhaarVerifyOtpResponseSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the aadhaar card holder. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "01-01-2000.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the aadhaar card holder.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public OfflineAadhaarVerifyOtpResponseSchema email(String email) { + + this.email = email; + return this; + } + + /** + * It displays the email address of the aadhaar card holder. + * @return email + **/ + @javax.annotation.Nullable + @Schema(example = "john123@gmail.com", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the email address of the aadhaar card holder.") + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public OfflineAadhaarVerifyOtpResponseSchema gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the aadhaar card holder. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "Male", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the aadhaar card holder.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public OfflineAadhaarVerifyOtpResponseSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the aadhaar card holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the aadhaar card holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public OfflineAadhaarVerifyOtpResponseSchema yearOfBirth(String yearOfBirth) { + + this.yearOfBirth = yearOfBirth; + return this; + } + + /** + * It displays the year of birth of the aadhaar card holder. + * @return yearOfBirth + **/ + @javax.annotation.Nullable + @Schema(example = "2000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the year of birth of the aadhaar card holder.") + public String getYearOfBirth() { + return yearOfBirth; + } + + + public void setYearOfBirth(String yearOfBirth) { + this.yearOfBirth = yearOfBirth; + } + + + public OfflineAadhaarVerifyOtpResponseSchema mobileHash(String mobileHash) { + + this.mobileHash = mobileHash; + return this; + } + + /** + * It displays the unique information about the device's hardware, software, and other characteristics. + * @return mobileHash + **/ + @javax.annotation.Nullable + @Schema(example = "v5c64757c746ytvfb687iyjg", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique information about the device's hardware, software, and other characteristics.") + public String getMobileHash() { + return mobileHash; + } + + + public void setMobileHash(String mobileHash) { + this.mobileHash = mobileHash; + } + + + public OfflineAadhaarVerifyOtpResponseSchema photoLink(String photoLink) { + + this.photoLink = photoLink; + return this; + } + + /** + * It displays the URL to the image present in the aadhaar card. + * @return photoLink + **/ + @javax.annotation.Nullable + @Schema(example = "IMAGE_LINK", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the URL to the image present in the aadhaar card.") + public String getPhotoLink() { + return photoLink; + } + + + public void setPhotoLink(String photoLink) { + this.photoLink = photoLink; + } + + + public OfflineAadhaarVerifyOtpResponseSchema splitAddress(OfflineAadhaarVerifyOtpResponseSchemaSplitAddress splitAddress) { + + this.splitAddress = splitAddress; + return this; + } + + /** + * Get splitAddress + * @return splitAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress getSplitAddress() { + return splitAddress; + } + + + public void setSplitAddress(OfflineAadhaarVerifyOtpResponseSchemaSplitAddress splitAddress) { + this.splitAddress = splitAddress; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OfflineAadhaarVerifyOtpResponseSchema offlineAadhaarVerifyOtpResponseSchema = (OfflineAadhaarVerifyOtpResponseSchema) o; + return Objects.equals(this.refId, offlineAadhaarVerifyOtpResponseSchema.refId) && + Objects.equals(this.status, offlineAadhaarVerifyOtpResponseSchema.status) && + Objects.equals(this.message, offlineAadhaarVerifyOtpResponseSchema.message) && + Objects.equals(this.careOf, offlineAadhaarVerifyOtpResponseSchema.careOf) && + Objects.equals(this.address, offlineAadhaarVerifyOtpResponseSchema.address) && + Objects.equals(this.dob, offlineAadhaarVerifyOtpResponseSchema.dob) && + Objects.equals(this.email, offlineAadhaarVerifyOtpResponseSchema.email) && + Objects.equals(this.gender, offlineAadhaarVerifyOtpResponseSchema.gender) && + Objects.equals(this.name, offlineAadhaarVerifyOtpResponseSchema.name) && + Objects.equals(this.yearOfBirth, offlineAadhaarVerifyOtpResponseSchema.yearOfBirth) && + Objects.equals(this.mobileHash, offlineAadhaarVerifyOtpResponseSchema.mobileHash) && + Objects.equals(this.photoLink, offlineAadhaarVerifyOtpResponseSchema.photoLink) && + Objects.equals(this.splitAddress, offlineAadhaarVerifyOtpResponseSchema.splitAddress); + } + + @Override + public int hashCode() { + return Objects.hash(refId, status, message, careOf, address, dob, email, gender, name, yearOfBirth, mobileHash, photoLink, splitAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OfflineAadhaarVerifyOtpResponseSchema {\n"); + sb.append(" refId: ").append(toIndentedString(refId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" careOf: ").append(toIndentedString(careOf)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" yearOfBirth: ").append(toIndentedString(yearOfBirth)).append("\n"); + sb.append(" mobileHash: ").append(toIndentedString(mobileHash)).append("\n"); + sb.append(" photoLink: ").append(toIndentedString(photoLink)).append("\n"); + sb.append(" splitAddress: ").append(toIndentedString(splitAddress)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ref_id"); + openapiFields.add("status"); + openapiFields.add("message"); + openapiFields.add("care_of"); + openapiFields.add("address"); + openapiFields.add("dob"); + openapiFields.add("email"); + openapiFields.add("gender"); + openapiFields.add("name"); + openapiFields.add("year_of_birth"); + openapiFields.add("mobile_hash"); + openapiFields.add("photo_link"); + openapiFields.add("split_address"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 OfflineAadhaarVerifyOtpResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ref_id") != null && !jsonObj.get("ref_id").isJsonNull()) && !jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("care_of") != null && !jsonObj.get("care_of").isJsonNull()) && !jsonObj.get("care_of").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `care_of` to be a primitive type in the JSON string but got `%s`", jsonObj.get("care_of").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("year_of_birth") != null && !jsonObj.get("year_of_birth").isJsonNull()) && !jsonObj.get("year_of_birth").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `year_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("year_of_birth").toString())); + } + if ((jsonObj.get("mobile_hash") != null && !jsonObj.get("mobile_hash").isJsonNull()) && !jsonObj.get("mobile_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_hash").toString())); + } + if ((jsonObj.get("photo_link") != null && !jsonObj.get("photo_link").isJsonNull()) && !jsonObj.get("photo_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `photo_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("photo_link").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.validateJsonElement(jsonObj.get("split_address")); + } + } + + + /** + * 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 OfflineAadhaarVerifyOtpResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ref_id") != null && !jsonObj.get("ref_id").isJsonNull()) && !jsonObj.get("ref_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("care_of") != null && !jsonObj.get("care_of").isJsonNull()) && !jsonObj.get("care_of").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `care_of` to be a primitive type in the JSON string but got `%s`", jsonObj.get("care_of").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("year_of_birth") != null && !jsonObj.get("year_of_birth").isJsonNull()) && !jsonObj.get("year_of_birth").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `year_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("year_of_birth").toString())); + } + if ((jsonObj.get("mobile_hash") != null && !jsonObj.get("mobile_hash").isJsonNull()) && !jsonObj.get("mobile_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_hash").toString())); + } + if ((jsonObj.get("photo_link") != null && !jsonObj.get("photo_link").isJsonNull()) && !jsonObj.get("photo_link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `photo_link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("photo_link").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.validateJsonElement(jsonObj.get("split_address")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OfflineAadhaarVerifyOtpResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OfflineAadhaarVerifyOtpResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OfflineAadhaarVerifyOtpResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OfflineAadhaarVerifyOtpResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OfflineAadhaarVerifyOtpResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OfflineAadhaarVerifyOtpResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of OfflineAadhaarVerifyOtpResponseSchema + * @throws IOException if the JSON string is invalid with respect to OfflineAadhaarVerifyOtpResponseSchema + */ + public static OfflineAadhaarVerifyOtpResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OfflineAadhaarVerifyOtpResponseSchema.class); + } + + /** + * Convert an instance of OfflineAadhaarVerifyOtpResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.java b/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.java new file mode 100644 index 0000000..41ba658 --- /dev/null +++ b/src/main/java/com/cashfree/model/OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.java @@ -0,0 +1,531 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the address information in individual components. + */ +@Schema(description = "It contains the address information in individual components.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class OfflineAadhaarVerifyOtpResponseSchemaSplitAddress { + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_DIST = "dist"; + @SerializedName(SERIALIZED_NAME_DIST) + private String dist; + + public static final String SERIALIZED_NAME_HOUSE = "house"; + @SerializedName(SERIALIZED_NAME_HOUSE) + private String house; + + public static final String SERIALIZED_NAME_LANDMARK = "landmark"; + @SerializedName(SERIALIZED_NAME_LANDMARK) + private String landmark; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_PO = "po"; + @SerializedName(SERIALIZED_NAME_PO) + private String po; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_STREET = "street"; + @SerializedName(SERIALIZED_NAME_STREET) + private String street; + + public static final String SERIALIZED_NAME_SUBDIST = "subdist"; + @SerializedName(SERIALIZED_NAME_SUBDIST) + private String subdist; + + public static final String SERIALIZED_NAME_VTC = "vtc"; + @SerializedName(SERIALIZED_NAME_VTC) + private String vtc; + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress() { + } + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress country(String country) { + + this.country = country; + return this; + } + + /** + * It displays the name of the country as present in the aadhaar card. + * @return country + **/ + @javax.annotation.Nullable + @Schema(example = "India", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the country as present in the aadhaar card.") + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress dist(String dist) { + + this.dist = dist; + return this; + } + + /** + * It displays the name of the district as present in the aadhaar card. + * @return dist + **/ + @javax.annotation.Nullable + @Schema(example = "Indore", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the district as present in the aadhaar card.") + public String getDist() { + return dist; + } + + + public void setDist(String dist) { + this.dist = dist; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress house(String house) { + + this.house = house; + return this; + } + + /** + * It displays the house name/number as present in the aadhaar card. + * @return house + **/ + @javax.annotation.Nullable + @Schema(example = "1234", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the house name/number as present in the aadhaar card.") + public String getHouse() { + return house; + } + + + public void setHouse(String house) { + this.house = house; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress landmark(String landmark) { + + this.landmark = landmark; + return this; + } + + /** + * It displays the name of the landmark as present in the aadhaar card. + * @return landmark + **/ + @javax.annotation.Nullable + @Schema(example = "Near ABC Hospital.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the landmark as present in the aadhaar card.") + public String getLandmark() { + return landmark; + } + + + public void setLandmark(String landmark) { + this.landmark = landmark; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code information as present in the aadhaar card. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "453551", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code information as present in the aadhaar card.") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress po(String po) { + + this.po = po; + return this; + } + + /** + * It displays the post office nearest to the address present. + * @return po + **/ + @javax.annotation.Nullable + @Schema(example = "Badodiya Khan.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the post office nearest to the address present.") + public String getPo() { + return po; + } + + + public void setPo(String po) { + this.po = po; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the name of the state as present in the aadhaar card. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "Madhya Pradesh", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state as present in the aadhaar card.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress street(String street) { + + this.street = street; + return this; + } + + /** + * It displays the name of the street as present in the aadhaar card. + * @return street + **/ + @javax.annotation.Nullable + @Schema(example = "ABC street", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the street as present in the aadhaar card.") + public String getStreet() { + return street; + } + + + public void setStreet(String street) { + this.street = street; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress subdist(String subdist) { + + this.subdist = subdist; + return this; + } + + /** + * It displays the name of the sub district as present in the aadhaar card. + * @return subdist + **/ + @javax.annotation.Nullable + @Schema(example = "Sanwer", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the sub district as present in the aadhaar card.") + public String getSubdist() { + return subdist; + } + + + public void setSubdist(String subdist) { + this.subdist = subdist; + } + + + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress vtc(String vtc) { + + this.vtc = vtc; + return this; + } + + /** + * It displays the village, town, city information as present in the aadhaar card. + * @return vtc + **/ + @javax.annotation.Nullable + @Schema(example = "Ajnod", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the village, town, city information as present in the aadhaar card.") + public String getVtc() { + return vtc; + } + + + public void setVtc(String vtc) { + this.vtc = vtc; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OfflineAadhaarVerifyOtpResponseSchemaSplitAddress offlineAadhaarVerifyOtpResponseSchemaSplitAddress = (OfflineAadhaarVerifyOtpResponseSchemaSplitAddress) o; + return Objects.equals(this.country, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.country) && + Objects.equals(this.dist, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.dist) && + Objects.equals(this.house, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.house) && + Objects.equals(this.landmark, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.landmark) && + Objects.equals(this.pincode, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.pincode) && + Objects.equals(this.po, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.po) && + Objects.equals(this.state, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.state) && + Objects.equals(this.street, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.street) && + Objects.equals(this.subdist, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.subdist) && + Objects.equals(this.vtc, offlineAadhaarVerifyOtpResponseSchemaSplitAddress.vtc); + } + + @Override + public int hashCode() { + return Objects.hash(country, dist, house, landmark, pincode, po, state, street, subdist, vtc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OfflineAadhaarVerifyOtpResponseSchemaSplitAddress {\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" dist: ").append(toIndentedString(dist)).append("\n"); + sb.append(" house: ").append(toIndentedString(house)).append("\n"); + sb.append(" landmark: ").append(toIndentedString(landmark)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" po: ").append(toIndentedString(po)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).append("\n"); + sb.append(" subdist: ").append(toIndentedString(subdist)).append("\n"); + sb.append(" vtc: ").append(toIndentedString(vtc)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("country"); + openapiFields.add("dist"); + openapiFields.add("house"); + openapiFields.add("landmark"); + openapiFields.add("pincode"); + openapiFields.add("po"); + openapiFields.add("state"); + openapiFields.add("street"); + openapiFields.add("subdist"); + openapiFields.add("vtc"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 OfflineAadhaarVerifyOtpResponseSchemaSplitAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("dist") != null && !jsonObj.get("dist").isJsonNull()) && !jsonObj.get("dist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dist").toString())); + } + if ((jsonObj.get("house") != null && !jsonObj.get("house").isJsonNull()) && !jsonObj.get("house").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `house` to be a primitive type in the JSON string but got `%s`", jsonObj.get("house").toString())); + } + if ((jsonObj.get("landmark") != null && !jsonObj.get("landmark").isJsonNull()) && !jsonObj.get("landmark").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `landmark` to be a primitive type in the JSON string but got `%s`", jsonObj.get("landmark").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("po") != null && !jsonObj.get("po").isJsonNull()) && !jsonObj.get("po").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `po` to be a primitive type in the JSON string but got `%s`", jsonObj.get("po").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("street") != null && !jsonObj.get("street").isJsonNull()) && !jsonObj.get("street").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + if ((jsonObj.get("subdist") != null && !jsonObj.get("subdist").isJsonNull()) && !jsonObj.get("subdist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subdist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subdist").toString())); + } + if ((jsonObj.get("vtc") != null && !jsonObj.get("vtc").isJsonNull()) && !jsonObj.get("vtc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vtc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vtc").toString())); + } + } + + + /** + * 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 OfflineAadhaarVerifyOtpResponseSchemaSplitAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("dist") != null && !jsonObj.get("dist").isJsonNull()) && !jsonObj.get("dist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dist").toString())); + } + if ((jsonObj.get("house") != null && !jsonObj.get("house").isJsonNull()) && !jsonObj.get("house").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `house` to be a primitive type in the JSON string but got `%s`", jsonObj.get("house").toString())); + } + if ((jsonObj.get("landmark") != null && !jsonObj.get("landmark").isJsonNull()) && !jsonObj.get("landmark").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `landmark` to be a primitive type in the JSON string but got `%s`", jsonObj.get("landmark").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("po") != null && !jsonObj.get("po").isJsonNull()) && !jsonObj.get("po").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `po` to be a primitive type in the JSON string but got `%s`", jsonObj.get("po").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("street") != null && !jsonObj.get("street").isJsonNull()) && !jsonObj.get("street").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + if ((jsonObj.get("subdist") != null && !jsonObj.get("subdist").isJsonNull()) && !jsonObj.get("subdist").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subdist` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subdist").toString())); + } + if ((jsonObj.get("vtc") != null && !jsonObj.get("vtc").isJsonNull()) && !jsonObj.get("vtc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vtc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vtc").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OfflineAadhaarVerifyOtpResponseSchemaSplitAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OfflineAadhaarVerifyOtpResponseSchemaSplitAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OfflineAadhaarVerifyOtpResponseSchemaSplitAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OfflineAadhaarVerifyOtpResponseSchemaSplitAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of OfflineAadhaarVerifyOtpResponseSchemaSplitAddress + * @throws IOException if the JSON string is invalid with respect to OfflineAadhaarVerifyOtpResponseSchemaSplitAddress + */ + public static OfflineAadhaarVerifyOtpResponseSchemaSplitAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OfflineAadhaarVerifyOtpResponseSchemaSplitAddress.class); + } + + /** + * Convert an instance of OfflineAadhaarVerifyOtpResponseSchemaSplitAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanAdvanceRequestSchema.java b/src/main/java/com/cashfree/model/PanAdvanceRequestSchema.java new file mode 100644 index 0000000..b8f923b --- /dev/null +++ b/src/main/java/com/cashfree/model/PanAdvanceRequestSchema.java @@ -0,0 +1,302 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify PAN information + */ +@Schema(description = "Find the request parameters to verify PAN information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanAdvanceRequestSchema { + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan = "AZJPG7110R"; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "testverificationid"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "JOHN SNOW"; + + public PanAdvanceRequestSchema() { + } + + public PanAdvanceRequestSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It is the unique 10-character alphanumeric identifier of the individual issued by the Income Tax Department. The first 5 should be alphabets followed by 4 numbers and the 10th character should again be an alphabet. + * @return pan + **/ + @javax.annotation.Nonnull + @Schema(example = "AZJPG7110R", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique 10-character alphanumeric identifier of the individual issued by the Income Tax Department. The first 5 should be alphabets followed by 4 numbers and the 10th character should again be an alphabet.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public PanAdvanceRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PanAdvanceRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the PAN information holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN SNOW", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the PAN information holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanAdvanceRequestSchema panAdvanceRequestSchema = (PanAdvanceRequestSchema) o; + return Objects.equals(this.pan, panAdvanceRequestSchema.pan) && + Objects.equals(this.verificationId, panAdvanceRequestSchema.verificationId) && + Objects.equals(this.name, panAdvanceRequestSchema.name); + } + + @Override + public int hashCode() { + return Objects.hash(pan, verificationId, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanAdvanceRequestSchema {\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pan"); + openapiFields.add("verification_id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pan"); + openapiRequiredFields.add("verification_id"); + } + + /** + * 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 PanAdvanceRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanAdvanceRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + + /** + * 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 PanAdvanceRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanAdvanceRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanAdvanceRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanAdvanceRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanAdvanceRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanAdvanceRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanAdvanceRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanAdvanceRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanAdvanceRequestSchema + * @throws IOException if the JSON string is invalid with respect to PanAdvanceRequestSchema + */ + public static PanAdvanceRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanAdvanceRequestSchema.class); + } + + /** + * Convert an instance of PanAdvanceRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanAdvanceResponseSchema.java b/src/main/java/com/cashfree/model/PanAdvanceResponseSchema.java new file mode 100644 index 0000000..ca3a83e --- /dev/null +++ b/src/main/java/com/cashfree/model/PanAdvanceResponseSchema.java @@ -0,0 +1,733 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.PanAdvanceResponseSchemaAddress; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for PAN Advance + */ +@Schema(description = "Success response for PAN Advance") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanAdvanceResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_NAME_PROVIDED = "name_provided"; + @SerializedName(SERIALIZED_NAME_NAME_PROVIDED) + private String nameProvided; + + public static final String SERIALIZED_NAME_REGISTERED_NAME = "registered_name"; + @SerializedName(SERIALIZED_NAME_REGISTERED_NAME) + private String registeredName; + + public static final String SERIALIZED_NAME_NAME_PAN_CARD = "name_pan_card"; + @SerializedName(SERIALIZED_NAME_NAME_PAN_CARD) + private String namePanCard; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "date_of_birth"; + @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) + private String dateOfBirth; + + public static final String SERIALIZED_NAME_MASKED_AADHAAR_NUMBER = "masked_aadhaar_number"; + @SerializedName(SERIALIZED_NAME_MASKED_AADHAAR_NUMBER) + private String maskedAadhaarNumber; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_MOBILE_NUMBER = "mobile_number"; + @SerializedName(SERIALIZED_NAME_MOBILE_NUMBER) + private String mobileNumber; + + public static final String SERIALIZED_NAME_AADHAAR_LINKED = "aadhaar_linked"; + @SerializedName(SERIALIZED_NAME_AADHAAR_LINKED) + private Boolean aadhaarLinked; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private PanAdvanceResponseSchemaAddress address; + + public PanAdvanceResponseSchema() { + } + + public PanAdvanceResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public PanAdvanceResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PanAdvanceResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the PAN information. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the PAN information.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public PanAdvanceResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "PAN verified successfully", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public PanAdvanceResponseSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It displays the PAN information entered in the API request. + * @return pan + **/ + @javax.annotation.Nullable + @Schema(example = "AZJPG7110R", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PAN information entered in the API request.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public PanAdvanceResponseSchema nameProvided(String nameProvided) { + + this.nameProvided = nameProvided; + return this; + } + + /** + * It displays the name entered in the API request. + * @return nameProvided + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN SNOW", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name entered in the API request.") + public String getNameProvided() { + return nameProvided; + } + + + public void setNameProvided(String nameProvided) { + this.nameProvided = nameProvided; + } + + + public PanAdvanceResponseSchema registeredName(String registeredName) { + + this.registeredName = registeredName; + return this; + } + + /** + * It displays the registererd name as present in the PAN information. + * @return registeredName + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN SNOW", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the registererd name as present in the PAN information.") + public String getRegisteredName() { + return registeredName; + } + + + public void setRegisteredName(String registeredName) { + this.registeredName = registeredName; + } + + + public PanAdvanceResponseSchema namePanCard(String namePanCard) { + + this.namePanCard = namePanCard; + return this; + } + + /** + * It displays the name as present in the PAN information. + * @return namePanCard + **/ + @javax.annotation.Nullable + @Schema(example = "JOHN SNOW", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name as present in the PAN information.") + public String getNamePanCard() { + return namePanCard; + } + + + public void setNamePanCard(String namePanCard) { + this.namePanCard = namePanCard; + } + + + public PanAdvanceResponseSchema type(String type) { + + this.type = type; + return this; + } + + /** + * It displays the type of the PAN issued. + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "Individual or Person", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of the PAN issued.") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public PanAdvanceResponseSchema gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the individual as present in the PAN information. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "Male", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the individual as present in the PAN information.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public PanAdvanceResponseSchema dateOfBirth(String dateOfBirth) { + + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * It displays the date of birth of the individual. + * @return dateOfBirth + **/ + @javax.annotation.Nullable + @Schema(example = "01/02/1990", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the individual.") + public String getDateOfBirth() { + return dateOfBirth; + } + + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + + public PanAdvanceResponseSchema maskedAadhaarNumber(String maskedAadhaarNumber) { + + this.maskedAadhaarNumber = maskedAadhaarNumber; + return this; + } + + /** + * It displays the masked aadhaar number of the individual. + * @return maskedAadhaarNumber + **/ + @javax.annotation.Nullable + @Schema(example = "XXXXXXXX8848", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the masked aadhaar number of the individual.") + public String getMaskedAadhaarNumber() { + return maskedAadhaarNumber; + } + + + public void setMaskedAadhaarNumber(String maskedAadhaarNumber) { + this.maskedAadhaarNumber = maskedAadhaarNumber; + } + + + public PanAdvanceResponseSchema email(String email) { + + this.email = email; + return this; + } + + /** + * It displays the email ID of the individual. + * @return email + **/ + @javax.annotation.Nullable + @Schema(example = "abc@gmail.com", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the email ID of the individual.") + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public PanAdvanceResponseSchema mobileNumber(String mobileNumber) { + + this.mobileNumber = mobileNumber; + return this; + } + + /** + * It displays the mobile number of the individual. + * @return mobileNumber + **/ + @javax.annotation.Nullable + @Schema(example = "9999999999", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the mobile number of the individual.") + public String getMobileNumber() { + return mobileNumber; + } + + + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber; + } + + + public PanAdvanceResponseSchema aadhaarLinked(Boolean aadhaarLinked) { + + this.aadhaarLinked = aadhaarLinked; + return this; + } + + /** + * It displays the aadhaar and PAN link status. + * @return aadhaarLinked + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the aadhaar and PAN link status.") + public Boolean getAadhaarLinked() { + return aadhaarLinked; + } + + + public void setAadhaarLinked(Boolean aadhaarLinked) { + this.aadhaarLinked = aadhaarLinked; + } + + + public PanAdvanceResponseSchema address(PanAdvanceResponseSchemaAddress address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public PanAdvanceResponseSchemaAddress getAddress() { + return address; + } + + + public void setAddress(PanAdvanceResponseSchemaAddress address) { + this.address = address; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanAdvanceResponseSchema panAdvanceResponseSchema = (PanAdvanceResponseSchema) o; + return Objects.equals(this.referenceId, panAdvanceResponseSchema.referenceId) && + Objects.equals(this.verificationId, panAdvanceResponseSchema.verificationId) && + Objects.equals(this.status, panAdvanceResponseSchema.status) && + Objects.equals(this.message, panAdvanceResponseSchema.message) && + Objects.equals(this.pan, panAdvanceResponseSchema.pan) && + Objects.equals(this.nameProvided, panAdvanceResponseSchema.nameProvided) && + Objects.equals(this.registeredName, panAdvanceResponseSchema.registeredName) && + Objects.equals(this.namePanCard, panAdvanceResponseSchema.namePanCard) && + Objects.equals(this.type, panAdvanceResponseSchema.type) && + Objects.equals(this.gender, panAdvanceResponseSchema.gender) && + Objects.equals(this.dateOfBirth, panAdvanceResponseSchema.dateOfBirth) && + Objects.equals(this.maskedAadhaarNumber, panAdvanceResponseSchema.maskedAadhaarNumber) && + Objects.equals(this.email, panAdvanceResponseSchema.email) && + Objects.equals(this.mobileNumber, panAdvanceResponseSchema.mobileNumber) && + Objects.equals(this.aadhaarLinked, panAdvanceResponseSchema.aadhaarLinked) && + Objects.equals(this.address, panAdvanceResponseSchema.address); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, status, message, pan, nameProvided, registeredName, namePanCard, type, gender, dateOfBirth, maskedAadhaarNumber, email, mobileNumber, aadhaarLinked, address); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanAdvanceResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" nameProvided: ").append(toIndentedString(nameProvided)).append("\n"); + sb.append(" registeredName: ").append(toIndentedString(registeredName)).append("\n"); + sb.append(" namePanCard: ").append(toIndentedString(namePanCard)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append(" maskedAadhaarNumber: ").append(toIndentedString(maskedAadhaarNumber)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" mobileNumber: ").append(toIndentedString(mobileNumber)).append("\n"); + sb.append(" aadhaarLinked: ").append(toIndentedString(aadhaarLinked)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("status"); + openapiFields.add("message"); + openapiFields.add("pan"); + openapiFields.add("name_provided"); + openapiFields.add("registered_name"); + openapiFields.add("name_pan_card"); + openapiFields.add("type"); + openapiFields.add("gender"); + openapiFields.add("date_of_birth"); + openapiFields.add("masked_aadhaar_number"); + openapiFields.add("email"); + openapiFields.add("mobile_number"); + openapiFields.add("aadhaar_linked"); + openapiFields.add("address"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PanAdvanceResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("name_provided") != null && !jsonObj.get("name_provided").isJsonNull()) && !jsonObj.get("name_provided").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_provided` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_provided").toString())); + } + if ((jsonObj.get("registered_name") != null && !jsonObj.get("registered_name").isJsonNull()) && !jsonObj.get("registered_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registered_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registered_name").toString())); + } + if ((jsonObj.get("name_pan_card") != null && !jsonObj.get("name_pan_card").isJsonNull()) && !jsonObj.get("name_pan_card").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_pan_card` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_pan_card").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("date_of_birth") != null && !jsonObj.get("date_of_birth").isJsonNull()) && !jsonObj.get("date_of_birth").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `date_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_of_birth").toString())); + } + if ((jsonObj.get("masked_aadhaar_number") != null && !jsonObj.get("masked_aadhaar_number").isJsonNull()) && !jsonObj.get("masked_aadhaar_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `masked_aadhaar_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masked_aadhaar_number").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + // validate the optional field `address` + if (jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) { + PanAdvanceResponseSchemaAddress.validateJsonElement(jsonObj.get("address")); + } + } + + + /** + * 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 PanAdvanceResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("name_provided") != null && !jsonObj.get("name_provided").isJsonNull()) && !jsonObj.get("name_provided").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_provided` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_provided").toString())); + } + if ((jsonObj.get("registered_name") != null && !jsonObj.get("registered_name").isJsonNull()) && !jsonObj.get("registered_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registered_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registered_name").toString())); + } + if ((jsonObj.get("name_pan_card") != null && !jsonObj.get("name_pan_card").isJsonNull()) && !jsonObj.get("name_pan_card").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_pan_card` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_pan_card").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("date_of_birth") != null && !jsonObj.get("date_of_birth").isJsonNull()) && !jsonObj.get("date_of_birth").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `date_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_of_birth").toString())); + } + if ((jsonObj.get("masked_aadhaar_number") != null && !jsonObj.get("masked_aadhaar_number").isJsonNull()) && !jsonObj.get("masked_aadhaar_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `masked_aadhaar_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masked_aadhaar_number").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + // validate the optional field `address` + if (jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) { + PanAdvanceResponseSchemaAddress.validateJsonElement(jsonObj.get("address")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanAdvanceResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanAdvanceResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanAdvanceResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanAdvanceResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanAdvanceResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanAdvanceResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanAdvanceResponseSchema + * @throws IOException if the JSON string is invalid with respect to PanAdvanceResponseSchema + */ + public static PanAdvanceResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanAdvanceResponseSchema.class); + } + + /** + * Convert an instance of PanAdvanceResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanAdvanceResponseSchemaAddress.java b/src/main/java/com/cashfree/model/PanAdvanceResponseSchemaAddress.java new file mode 100644 index 0000000..e93567f --- /dev/null +++ b/src/main/java/com/cashfree/model/PanAdvanceResponseSchemaAddress.java @@ -0,0 +1,385 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It displays the address information of the individual. + */ +@Schema(description = "It displays the address information of the individual.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanAdvanceResponseSchemaAddress { + public static final String SERIALIZED_NAME_FULL_ADDRESS = "full_address"; + @SerializedName(SERIALIZED_NAME_FULL_ADDRESS) + private String fullAddress; + + public static final String SERIALIZED_NAME_STREET = "street"; + @SerializedName(SERIALIZED_NAME_STREET) + private String street; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private Integer pincode; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public PanAdvanceResponseSchemaAddress() { + } + + public PanAdvanceResponseSchemaAddress fullAddress(String fullAddress) { + + this.fullAddress = fullAddress; + return this; + } + + /** + * It displays the complete address of the individual. + * @return fullAddress + **/ + @javax.annotation.Nullable + @Schema(example = "Quarter - A, Block - B Sample Area, ABC Street 700011 KOLKATA WEST BENGAL INDIA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the complete address of the individual.") + public String getFullAddress() { + return fullAddress; + } + + + public void setFullAddress(String fullAddress) { + this.fullAddress = fullAddress; + } + + + public PanAdvanceResponseSchemaAddress street(String street) { + + this.street = street; + return this; + } + + /** + * It displays the street name from the individual's address. + * @return street + **/ + @javax.annotation.Nullable + @Schema(example = "ABC Street", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the street name from the individual's address.") + public String getStreet() { + return street; + } + + + public void setStreet(String street) { + this.street = street; + } + + + public PanAdvanceResponseSchemaAddress city(String city) { + + this.city = city; + return this; + } + + /** + * It displays the city name from the individual's address. + * @return city + **/ + @javax.annotation.Nullable + @Schema(example = "KOLKATA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the city name from the individual's address.") + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + public PanAdvanceResponseSchemaAddress state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the state name from the individual's address. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "WEST BENGAL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the state name from the individual's address.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public PanAdvanceResponseSchemaAddress pincode(Integer pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code from the individual's address. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "700011", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code from the individual's address.") + public Integer getPincode() { + return pincode; + } + + + public void setPincode(Integer pincode) { + this.pincode = pincode; + } + + + public PanAdvanceResponseSchemaAddress country(String country) { + + this.country = country; + return this; + } + + /** + * It displays the country name from the individual's address. + * @return country + **/ + @javax.annotation.Nullable + @Schema(example = "India", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the country name from the individual's address.") + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanAdvanceResponseSchemaAddress panAdvanceResponseSchemaAddress = (PanAdvanceResponseSchemaAddress) o; + return Objects.equals(this.fullAddress, panAdvanceResponseSchemaAddress.fullAddress) && + Objects.equals(this.street, panAdvanceResponseSchemaAddress.street) && + Objects.equals(this.city, panAdvanceResponseSchemaAddress.city) && + Objects.equals(this.state, panAdvanceResponseSchemaAddress.state) && + Objects.equals(this.pincode, panAdvanceResponseSchemaAddress.pincode) && + Objects.equals(this.country, panAdvanceResponseSchemaAddress.country); + } + + @Override + public int hashCode() { + return Objects.hash(fullAddress, street, city, state, pincode, country); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanAdvanceResponseSchemaAddress {\n"); + sb.append(" fullAddress: ").append(toIndentedString(fullAddress)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("full_address"); + openapiFields.add("street"); + openapiFields.add("city"); + openapiFields.add("state"); + openapiFields.add("pincode"); + openapiFields.add("country"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PanAdvanceResponseSchemaAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("full_address") != null && !jsonObj.get("full_address").isJsonNull()) && !jsonObj.get("full_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `full_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("full_address").toString())); + } + if ((jsonObj.get("street") != null && !jsonObj.get("street").isJsonNull()) && !jsonObj.get("street").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + if ((jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull()) && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + } + + + /** + * 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 PanAdvanceResponseSchemaAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("full_address") != null && !jsonObj.get("full_address").isJsonNull()) && !jsonObj.get("full_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `full_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("full_address").toString())); + } + if ((jsonObj.get("street") != null && !jsonObj.get("street").isJsonNull()) && !jsonObj.get("street").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + if ((jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull()) && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanAdvanceResponseSchemaAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanAdvanceResponseSchemaAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanAdvanceResponseSchemaAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanAdvanceResponseSchemaAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanAdvanceResponseSchemaAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanAdvanceResponseSchemaAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanAdvanceResponseSchemaAddress + * @throws IOException if the JSON string is invalid with respect to PanAdvanceResponseSchemaAddress + */ + public static PanAdvanceResponseSchemaAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanAdvanceResponseSchemaAddress.class); + } + + /** + * Convert an instance of PanAdvanceResponseSchemaAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanOcrRequestSchema.java b/src/main/java/com/cashfree/model/PanOcrRequestSchema.java new file mode 100644 index 0000000..c6d73a0 --- /dev/null +++ b/src/main/java/com/cashfree/model/PanOcrRequestSchema.java @@ -0,0 +1,262 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify PAN via OCR + */ +@Schema(description = "Find the request parameters to verify PAN via OCR") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanOcrRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "12345678"; + + public static final String SERIALIZED_NAME_FRONT_IMAGE = "front_image"; + @SerializedName(SERIALIZED_NAME_FRONT_IMAGE) + private File frontImage; + + public PanOcrRequestSchema() { + } + + public PanOcrRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "12345678", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PanOcrRequestSchema frontImage(File frontImage) { + + this.frontImage = frontImage; + return this; + } + + /** + * It is the scanned copy of the PAN card. Allowed file type - JPEG/JPG/PNG. + * @return frontImage + **/ + @javax.annotation.Nonnull + @Schema(example = "[B@58690f5e", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the scanned copy of the PAN card. Allowed file type - JPEG/JPG/PNG.") + public File getFrontImage() { + return frontImage; + } + + + public void setFrontImage(File frontImage) { + this.frontImage = frontImage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanOcrRequestSchema panOcrRequestSchema = (PanOcrRequestSchema) o; + return Objects.equals(this.verificationId, panOcrRequestSchema.verificationId) && + Objects.equals(this.frontImage, panOcrRequestSchema.frontImage); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, frontImage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanOcrRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" frontImage: ").append(toIndentedString(frontImage)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("front_image"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("front_image"); + } + + /** + * 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 PanOcrRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanOcrRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 PanOcrRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanOcrRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanOcrRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanOcrRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanOcrRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanOcrRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanOcrRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanOcrRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanOcrRequestSchema + * @throws IOException if the JSON string is invalid with respect to PanOcrRequestSchema + */ + public static PanOcrRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanOcrRequestSchema.class); + } + + /** + * Convert an instance of PanOcrRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanOcrResponseSchema.java b/src/main/java/com/cashfree/model/PanOcrResponseSchema.java new file mode 100644 index 0000000..21ee461 --- /dev/null +++ b/src/main/java/com/cashfree/model/PanOcrResponseSchema.java @@ -0,0 +1,665 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * PAN Verification via OCR success response + */ +@Schema(description = "PAN Verification via OCR success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanOcrResponseSchema { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORGANIZATION_NAME = "organization_name"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION_NAME) + private String organizationName; + + public static final String SERIALIZED_NAME_PAN_TYPE = "pan_type"; + @SerializedName(SERIALIZED_NAME_PAN_TYPE) + private String panType; + + public static final String SERIALIZED_NAME_DATE_OF_INCORPORATION = "date_of_incorporation"; + @SerializedName(SERIALIZED_NAME_DATE_OF_INCORPORATION) + private String dateOfIncorporation; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_FATHER = "father"; + @SerializedName(SERIALIZED_NAME_FATHER) + private String father; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_VALID = "valid"; + @SerializedName(SERIALIZED_NAME_VALID) + private Boolean valid; + + public static final String SERIALIZED_NAME_AGE = "age"; + @SerializedName(SERIALIZED_NAME_AGE) + private String age; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_CONFIDENCE_SCORE = "confidence_score"; + @SerializedName(SERIALIZED_NAME_CONFIDENCE_SCORE) + private String confidenceScore; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public PanOcrResponseSchema() { + } + + public PanOcrResponseSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the PAN holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the PAN holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PanOcrResponseSchema organizationName(String organizationName) { + + this.organizationName = organizationName; + return this; + } + + /** + * It displays the name of the organisation the individual runs. + * @return organizationName + **/ + @javax.annotation.Nullable + @Schema(example = "ABC pvt ltd.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the organisation the individual runs.") + public String getOrganizationName() { + return organizationName; + } + + + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; + } + + + public PanOcrResponseSchema panType(String panType) { + + this.panType = panType; + return this; + } + + /** + * It displays the type of PAN issued to the individual. + * @return panType + **/ + @javax.annotation.Nullable + @Schema(example = "Business", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of PAN issued to the individual.") + public String getPanType() { + return panType; + } + + + public void setPanType(String panType) { + this.panType = panType; + } + + + public PanOcrResponseSchema dateOfIncorporation(String dateOfIncorporation) { + + this.dateOfIncorporation = dateOfIncorporation; + return this; + } + + /** + * It displays the incorporation date of the individual's organisation. + * @return dateOfIncorporation + **/ + @javax.annotation.Nullable + @Schema(example = "01-01-2000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the incorporation date of the individual's organisation.") + public String getDateOfIncorporation() { + return dateOfIncorporation; + } + + + public void setDateOfIncorporation(String dateOfIncorporation) { + this.dateOfIncorporation = dateOfIncorporation; + } + + + public PanOcrResponseSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the individual. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "01-01-1990", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the individual.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public PanOcrResponseSchema father(String father) { + + this.father = father; + return this; + } + + /** + * It displays the father's name of the individual. + * @return father + **/ + @javax.annotation.Nullable + @Schema(example = "Jone Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the father's name of the individual.") + public String getFather() { + return father; + } + + + public void setFather(String father) { + this.father = father; + } + + + public PanOcrResponseSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It displays the entered PAN information in the request. + * @return pan + **/ + @javax.annotation.Nullable + @Schema(example = "ABCPP3011E", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the entered PAN information in the request.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public PanOcrResponseSchema valid(Boolean valid) { + + this.valid = valid; + return this; + } + + /** + * It displays whethere the entered PAN information is valid. + * @return valid + **/ + @javax.annotation.Nullable + @Schema(example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whethere the entered PAN information is valid.") + public Boolean getValid() { + return valid; + } + + + public void setValid(Boolean valid) { + this.valid = valid; + } + + + public PanOcrResponseSchema age(String age) { + + this.age = age; + return this; + } + + /** + * It displays the age of the individual. + * @return age + **/ + @javax.annotation.Nullable + @Schema(example = "20", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the age of the individual.") + public String getAge() { + return age; + } + + + public void setAge(String age) { + this.age = age; + } + + + public PanOcrResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the PAN information. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "Valid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the PAN information.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public PanOcrResponseSchema referenceId(String referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "123456789", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public String getReferenceId() { + return referenceId; + } + + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + public PanOcrResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "1676668986", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PanOcrResponseSchema confidenceScore(String confidenceScore) { + + this.confidenceScore = confidenceScore; + return this; + } + + /** + * It displays the level of confidence or reliability associated with the PAN verification. + * @return confidenceScore + **/ + @javax.annotation.Nullable + @Schema(example = "0.98", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the level of confidence or reliability associated with the PAN verification.") + public String getConfidenceScore() { + return confidenceScore; + } + + + public void setConfidenceScore(String confidenceScore) { + this.confidenceScore = confidenceScore; + } + + + public PanOcrResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "Valid PAN", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanOcrResponseSchema panOcrResponseSchema = (PanOcrResponseSchema) o; + return Objects.equals(this.name, panOcrResponseSchema.name) && + Objects.equals(this.organizationName, panOcrResponseSchema.organizationName) && + Objects.equals(this.panType, panOcrResponseSchema.panType) && + Objects.equals(this.dateOfIncorporation, panOcrResponseSchema.dateOfIncorporation) && + Objects.equals(this.dob, panOcrResponseSchema.dob) && + Objects.equals(this.father, panOcrResponseSchema.father) && + Objects.equals(this.pan, panOcrResponseSchema.pan) && + Objects.equals(this.valid, panOcrResponseSchema.valid) && + Objects.equals(this.age, panOcrResponseSchema.age) && + Objects.equals(this.status, panOcrResponseSchema.status) && + Objects.equals(this.referenceId, panOcrResponseSchema.referenceId) && + Objects.equals(this.verificationId, panOcrResponseSchema.verificationId) && + Objects.equals(this.confidenceScore, panOcrResponseSchema.confidenceScore) && + Objects.equals(this.message, panOcrResponseSchema.message); + } + + @Override + public int hashCode() { + return Objects.hash(name, organizationName, panType, dateOfIncorporation, dob, father, pan, valid, age, status, referenceId, verificationId, confidenceScore, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanOcrResponseSchema {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" organizationName: ").append(toIndentedString(organizationName)).append("\n"); + sb.append(" panType: ").append(toIndentedString(panType)).append("\n"); + sb.append(" dateOfIncorporation: ").append(toIndentedString(dateOfIncorporation)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" father: ").append(toIndentedString(father)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" confidenceScore: ").append(toIndentedString(confidenceScore)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("organization_name"); + openapiFields.add("pan_type"); + openapiFields.add("date_of_incorporation"); + openapiFields.add("dob"); + openapiFields.add("father"); + openapiFields.add("pan"); + openapiFields.add("valid"); + openapiFields.add("age"); + openapiFields.add("status"); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("confidence_score"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PanOcrResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("organization_name") != null && !jsonObj.get("organization_name").isJsonNull()) && !jsonObj.get("organization_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organization_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_name").toString())); + } + if ((jsonObj.get("pan_type") != null && !jsonObj.get("pan_type").isJsonNull()) && !jsonObj.get("pan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan_type").toString())); + } + if ((jsonObj.get("date_of_incorporation") != null && !jsonObj.get("date_of_incorporation").isJsonNull()) && !jsonObj.get("date_of_incorporation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `date_of_incorporation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_of_incorporation").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("father") != null && !jsonObj.get("father").isJsonNull()) && !jsonObj.get("father").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("age") != null && !jsonObj.get("age").isJsonNull()) && !jsonObj.get("age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("age").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reference_id") != null && !jsonObj.get("reference_id").isJsonNull()) && !jsonObj.get("reference_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference_id").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("confidence_score") != null && !jsonObj.get("confidence_score").isJsonNull()) && !jsonObj.get("confidence_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `confidence_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("confidence_score").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 PanOcrResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("organization_name") != null && !jsonObj.get("organization_name").isJsonNull()) && !jsonObj.get("organization_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organization_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_name").toString())); + } + if ((jsonObj.get("pan_type") != null && !jsonObj.get("pan_type").isJsonNull()) && !jsonObj.get("pan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan_type").toString())); + } + if ((jsonObj.get("date_of_incorporation") != null && !jsonObj.get("date_of_incorporation").isJsonNull()) && !jsonObj.get("date_of_incorporation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `date_of_incorporation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("date_of_incorporation").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("father") != null && !jsonObj.get("father").isJsonNull()) && !jsonObj.get("father").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("age") != null && !jsonObj.get("age").isJsonNull()) && !jsonObj.get("age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("age").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reference_id") != null && !jsonObj.get("reference_id").isJsonNull()) && !jsonObj.get("reference_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference_id").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("confidence_score") != null && !jsonObj.get("confidence_score").isJsonNull()) && !jsonObj.get("confidence_score").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `confidence_score` to be a primitive type in the JSON string but got `%s`", jsonObj.get("confidence_score").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanOcrResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanOcrResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanOcrResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanOcrResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanOcrResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanOcrResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanOcrResponseSchema + * @throws IOException if the JSON string is invalid with respect to PanOcrResponseSchema + */ + public static PanOcrResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanOcrResponseSchema.class); + } + + /** + * Convert an instance of PanOcrResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanRequestSchema.java b/src/main/java/com/cashfree/model/PanRequestSchema.java new file mode 100644 index 0000000..de71d50 --- /dev/null +++ b/src/main/java/com/cashfree/model/PanRequestSchema.java @@ -0,0 +1,266 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify PAN + */ +@Schema(description = "Find the request parameters to verify PAN") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanRequestSchema { + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan = "ABCPV1234D"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "Gurav"; + + public PanRequestSchema() { + } + + public PanRequestSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It is the unique 10-character alphanumeric identifier of the individual issued by the Income Tax Department. The first 5 should be alphabets followed by 4 numbers and the 10th character should again be an alphabet. + * @return pan + **/ + @javax.annotation.Nonnull + @Schema(example = "ABCPV1234D", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique 10-character alphanumeric identifier of the individual issued by the Income Tax Department. The first 5 should be alphabets followed by 4 numbers and the 10th character should again be an alphabet.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public PanRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the individual. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "Gurav", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the individual.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanRequestSchema panRequestSchema = (PanRequestSchema) o; + return Objects.equals(this.pan, panRequestSchema.pan) && + Objects.equals(this.name, panRequestSchema.name); + } + + @Override + public int hashCode() { + return Objects.hash(pan, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanRequestSchema {\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pan"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pan"); + } + + /** + * 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 PanRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + + /** + * 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 PanRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanRequestSchema + * @throws IOException if the JSON string is invalid with respect to PanRequestSchema + */ + public static PanRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanRequestSchema.class); + } + + /** + * Convert an instance of PanRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanToGstinRequestSchema.java b/src/main/java/com/cashfree/model/PanToGstinRequestSchema.java new file mode 100644 index 0000000..929f41f --- /dev/null +++ b/src/main/java/com/cashfree/model/PanToGstinRequestSchema.java @@ -0,0 +1,267 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to fetch the list of GSTIN associated with PAN + */ +@Schema(description = "Find the request parameters to fetch the list of GSTIN associated with PAN") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanToGstinRequestSchema { + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan = "AZJPG7110R"; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "testverificationid"; + + public PanToGstinRequestSchema() { + } + + public PanToGstinRequestSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It is the unique 10-character alphanumeric identifier issued by the Income Tax Department. + * @return pan + **/ + @javax.annotation.Nonnull + @Schema(example = "AZJPG7110R", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique 10-character alphanumeric identifier issued by the Income Tax Department.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public PanToGstinRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the request. The maximum character limit is 50. Alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the request. The maximum character limit is 50. Alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanToGstinRequestSchema panToGstinRequestSchema = (PanToGstinRequestSchema) o; + return Objects.equals(this.pan, panToGstinRequestSchema.pan) && + Objects.equals(this.verificationId, panToGstinRequestSchema.verificationId); + } + + @Override + public int hashCode() { + return Objects.hash(pan, verificationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanToGstinRequestSchema {\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pan"); + openapiFields.add("verification_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pan"); + openapiRequiredFields.add("verification_id"); + } + + /** + * 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 PanToGstinRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanToGstinRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + } + + + /** + * 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 PanToGstinRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PanToGstinRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanToGstinRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanToGstinRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanToGstinRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanToGstinRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanToGstinRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanToGstinRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanToGstinRequestSchema + * @throws IOException if the JSON string is invalid with respect to PanToGstinRequestSchema + */ + public static PanToGstinRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanToGstinRequestSchema.class); + } + + /** + * Convert an instance of PanToGstinRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanToGstinResponseSchema.java b/src/main/java/com/cashfree/model/PanToGstinResponseSchema.java new file mode 100644 index 0000000..5197cb4 --- /dev/null +++ b/src/main/java/com/cashfree/model/PanToGstinResponseSchema.java @@ -0,0 +1,418 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.PanToGstinResponseSchemaGstinListInner; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Fetch GSTIN with PAN + */ +@Schema(description = "Success response for Fetch GSTIN with PAN") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanToGstinResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public static final String SERIALIZED_NAME_GSTIN_LIST = "gstin_list"; + @SerializedName(SERIALIZED_NAME_GSTIN_LIST) + private List gstinList; + + public PanToGstinResponseSchema() { + } + + public PanToGstinResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public PanToGstinResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you create to identity the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you create to identity the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PanToGstinResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request. ") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public PanToGstinResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "Gstins List found", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public PanToGstinResponseSchema pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * It displays the entered PAN information in the request. + * @return pan + **/ + @javax.annotation.Nullable + @Schema(example = "AZJPG7110R", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the entered PAN information in the request.") + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + public PanToGstinResponseSchema gstinList(List gstinList) { + + this.gstinList = gstinList; + return this; + } + + public PanToGstinResponseSchema addGstinListItem(PanToGstinResponseSchemaGstinListInner gstinListItem) { + if (this.gstinList == null) { + this.gstinList = new ArrayList<>(); + } + this.gstinList.add(gstinListItem); + return this; + } + + /** + * It displays the list of GSTIN associated with the entered PAN. + * @return gstinList + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the list of GSTIN associated with the entered PAN.") + public List getGstinList() { + return gstinList; + } + + + public void setGstinList(List gstinList) { + this.gstinList = gstinList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanToGstinResponseSchema panToGstinResponseSchema = (PanToGstinResponseSchema) o; + return Objects.equals(this.referenceId, panToGstinResponseSchema.referenceId) && + Objects.equals(this.verificationId, panToGstinResponseSchema.verificationId) && + Objects.equals(this.status, panToGstinResponseSchema.status) && + Objects.equals(this.message, panToGstinResponseSchema.message) && + Objects.equals(this.pan, panToGstinResponseSchema.pan) && + Objects.equals(this.gstinList, panToGstinResponseSchema.gstinList); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, status, message, pan, gstinList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanToGstinResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append(" gstinList: ").append(toIndentedString(gstinList)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("status"); + openapiFields.add("message"); + openapiFields.add("pan"); + openapiFields.add("gstin_list"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PanToGstinResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if (jsonObj.get("gstin_list") != null && !jsonObj.get("gstin_list").isJsonNull()) { + JsonArray jsonArraygstinList = jsonObj.getAsJsonArray("gstin_list"); + if (jsonArraygstinList != null) { + // ensure the json data is an array + if (!jsonObj.get("gstin_list").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `gstin_list` to be an array in the JSON string but got `%s`", jsonObj.get("gstin_list").toString())); + } + + // validate the optional field `gstin_list` (array) + for (int i = 0; i < jsonArraygstinList.size(); i++) { + PanToGstinResponseSchemaGstinListInner.validateJsonElement(jsonArraygstinList.get(i)); + }; + } + } + } + + + /** + * 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 PanToGstinResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonNull()) && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + if (jsonObj.get("gstin_list") != null && !jsonObj.get("gstin_list").isJsonNull()) { + JsonArray jsonArraygstinList = jsonObj.getAsJsonArray("gstin_list"); + if (jsonArraygstinList != null) { + // ensure the json data is an array + if (!jsonObj.get("gstin_list").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `gstin_list` to be an array in the JSON string but got `%s`", jsonObj.get("gstin_list").toString())); + } + + // validate the optional field `gstin_list` (array) + for (int i = 0; i < jsonArraygstinList.size(); i++) { + PanToGstinResponseSchemaGstinListInner.validateJsonElement(jsonArraygstinList.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanToGstinResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanToGstinResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanToGstinResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanToGstinResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanToGstinResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanToGstinResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanToGstinResponseSchema + * @throws IOException if the JSON string is invalid with respect to PanToGstinResponseSchema + */ + public static PanToGstinResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanToGstinResponseSchema.class); + } + + /** + * Convert an instance of PanToGstinResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PanToGstinResponseSchemaGstinListInner.java b/src/main/java/com/cashfree/model/PanToGstinResponseSchemaGstinListInner.java new file mode 100644 index 0000000..6a8859d --- /dev/null +++ b/src/main/java/com/cashfree/model/PanToGstinResponseSchemaGstinListInner.java @@ -0,0 +1,285 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * PanToGstinResponseSchemaGstinListInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PanToGstinResponseSchemaGstinListInner { + public static final String SERIALIZED_NAME_GSTIN = "gstin"; + @SerializedName(SERIALIZED_NAME_GSTIN) + private String gstin; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public PanToGstinResponseSchemaGstinListInner() { + } + + public PanToGstinResponseSchemaGstinListInner gstin(String gstin) { + + this.gstin = gstin; + return this; + } + + /** + * It displays the GSTIN information. + * @return gstin + **/ + @javax.annotation.Nullable + @Schema(example = "29AAFCD5862R1ZR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the GSTIN information.") + public String getGstin() { + return gstin; + } + + + public void setGstin(String gstin) { + this.gstin = gstin; + } + + + public PanToGstinResponseSchemaGstinListInner status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the GSTIN associated with the entered PAN. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "ACTIVE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the GSTIN associated with the entered PAN.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public PanToGstinResponseSchemaGstinListInner state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the name of the state. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "KARNATAKA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PanToGstinResponseSchemaGstinListInner panToGstinResponseSchemaGstinListInner = (PanToGstinResponseSchemaGstinListInner) o; + return Objects.equals(this.gstin, panToGstinResponseSchemaGstinListInner.gstin) && + Objects.equals(this.status, panToGstinResponseSchemaGstinListInner.status) && + Objects.equals(this.state, panToGstinResponseSchemaGstinListInner.state); + } + + @Override + public int hashCode() { + return Objects.hash(gstin, status, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PanToGstinResponseSchemaGstinListInner {\n"); + sb.append(" gstin: ").append(toIndentedString(gstin)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("gstin"); + openapiFields.add("status"); + openapiFields.add("state"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PanToGstinResponseSchemaGstinListInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("gstin") != null && !jsonObj.get("gstin").isJsonNull()) && !jsonObj.get("gstin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gstin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gstin").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + } + + + /** + * 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 PanToGstinResponseSchemaGstinListInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("gstin") != null && !jsonObj.get("gstin").isJsonNull()) && !jsonObj.get("gstin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gstin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gstin").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PanToGstinResponseSchemaGstinListInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PanToGstinResponseSchemaGstinListInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PanToGstinResponseSchemaGstinListInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PanToGstinResponseSchemaGstinListInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PanToGstinResponseSchemaGstinListInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PanToGstinResponseSchemaGstinListInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PanToGstinResponseSchemaGstinListInner + * @throws IOException if the JSON string is invalid with respect to PanToGstinResponseSchemaGstinListInner + */ + public static PanToGstinResponseSchemaGstinListInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PanToGstinResponseSchemaGstinListInner.class); + } + + /** + * Convert an instance of PanToGstinResponseSchemaGstinListInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PassportVerificationRequestSchema.java b/src/main/java/com/cashfree/model/PassportVerificationRequestSchema.java new file mode 100644 index 0000000..e32da1b --- /dev/null +++ b/src/main/java/com/cashfree/model/PassportVerificationRequestSchema.java @@ -0,0 +1,338 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify passport information + */ +@Schema(description = "Find the request parameters to verify passport information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PassportVerificationRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "ABC00123"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FILE_NUMBER = "file_number"; + @SerializedName(SERIALIZED_NAME_FILE_NUMBER) + private String fileNumber = "PA1079341954215"; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob = "2007-03-01"; + + public PassportVerificationRequestSchema() { + } + + public PassportVerificationRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PassportVerificationRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the passport holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the passport holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PassportVerificationRequestSchema fileNumber(String fileNumber) { + + this.fileNumber = fileNumber; + return this; + } + + /** + * It is the unique alphanumeric code that identifies an individual's passport application. + * @return fileNumber + **/ + @javax.annotation.Nonnull + @Schema(example = "PA1079341954215", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique alphanumeric code that identifies an individual's passport application.") + public String getFileNumber() { + return fileNumber; + } + + + public void setFileNumber(String fileNumber) { + this.fileNumber = fileNumber; + } + + + public PassportVerificationRequestSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It is the date of birth of the passport holder. The format is YYYY-MM-DD. + * @return dob + **/ + @javax.annotation.Nonnull + @Schema(example = "2007-03-01", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the date of birth of the passport holder. The format is YYYY-MM-DD.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PassportVerificationRequestSchema passportVerificationRequestSchema = (PassportVerificationRequestSchema) o; + return Objects.equals(this.verificationId, passportVerificationRequestSchema.verificationId) && + Objects.equals(this.name, passportVerificationRequestSchema.name) && + Objects.equals(this.fileNumber, passportVerificationRequestSchema.fileNumber) && + Objects.equals(this.dob, passportVerificationRequestSchema.dob); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, name, fileNumber, dob); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PassportVerificationRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fileNumber: ").append(toIndentedString(fileNumber)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("name"); + openapiFields.add("file_number"); + openapiFields.add("dob"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("file_number"); + openapiRequiredFields.add("dob"); + } + + /** + * 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 PassportVerificationRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PassportVerificationRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("file_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_number").toString())); + } + if (!jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + } + + + /** + * 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 PassportVerificationRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PassportVerificationRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("file_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_number").toString())); + } + if (!jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PassportVerificationRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PassportVerificationRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PassportVerificationRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PassportVerificationRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PassportVerificationRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PassportVerificationRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PassportVerificationRequestSchema + * @throws IOException if the JSON string is invalid with respect to PassportVerificationRequestSchema + */ + public static PassportVerificationRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PassportVerificationRequestSchema.class); + } + + /** + * Convert an instance of PassportVerificationRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PassportVerificationResponseSchema.java b/src/main/java/com/cashfree/model/PassportVerificationResponseSchema.java new file mode 100644 index 0000000..4568679 --- /dev/null +++ b/src/main/java/com/cashfree/model/PassportVerificationResponseSchema.java @@ -0,0 +1,455 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for Verify Passport + */ +@Schema(description = "Success response for Verify Passport") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PassportVerificationResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_FILE_NUMBER = "file_number"; + @SerializedName(SERIALIZED_NAME_FILE_NUMBER) + private String fileNumber; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_APPLICATION_TYPE = "application_type"; + @SerializedName(SERIALIZED_NAME_APPLICATION_TYPE) + private String applicationType; + + public static final String SERIALIZED_NAME_APPLICATION_RECEIVED_DATE = "application_received_date"; + @SerializedName(SERIALIZED_NAME_APPLICATION_RECEIVED_DATE) + private String applicationReceivedDate; + + public PassportVerificationResponseSchema() { + } + + public PassportVerificationResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public PassportVerificationResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "ABC00123", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public PassportVerificationResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the passport. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the passport.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public PassportVerificationResponseSchema fileNumber(String fileNumber) { + + this.fileNumber = fileNumber; + return this; + } + + /** + * It displays the unique alphanumeric code that identifies an individual's passport application. + * @return fileNumber + **/ + @javax.annotation.Nullable + @Schema(example = "XX0000000000000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique alphanumeric code that identifies an individual's passport application.") + public String getFileNumber() { + return fileNumber; + } + + + public void setFileNumber(String fileNumber) { + this.fileNumber = fileNumber; + } + + + public PassportVerificationResponseSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the passport holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the passport holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PassportVerificationResponseSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the passport holder. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "YYYY-MM-DD", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the passport holder.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public PassportVerificationResponseSchema applicationType(String applicationType) { + + this.applicationType = applicationType; + return this; + } + + /** + * It displays the type of passport application. + * @return applicationType + **/ + @javax.annotation.Nullable + @Schema(example = "NORMAL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of passport application.") + public String getApplicationType() { + return applicationType; + } + + + public void setApplicationType(String applicationType) { + this.applicationType = applicationType; + } + + + public PassportVerificationResponseSchema applicationReceivedDate(String applicationReceivedDate) { + + this.applicationReceivedDate = applicationReceivedDate; + return this; + } + + /** + * It displays when the passport application was received. + * @return applicationReceivedDate + **/ + @javax.annotation.Nullable + @Schema(example = "YYYY-MM-DD", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays when the passport application was received.") + public String getApplicationReceivedDate() { + return applicationReceivedDate; + } + + + public void setApplicationReceivedDate(String applicationReceivedDate) { + this.applicationReceivedDate = applicationReceivedDate; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PassportVerificationResponseSchema passportVerificationResponseSchema = (PassportVerificationResponseSchema) o; + return Objects.equals(this.referenceId, passportVerificationResponseSchema.referenceId) && + Objects.equals(this.verificationId, passportVerificationResponseSchema.verificationId) && + Objects.equals(this.status, passportVerificationResponseSchema.status) && + Objects.equals(this.fileNumber, passportVerificationResponseSchema.fileNumber) && + Objects.equals(this.name, passportVerificationResponseSchema.name) && + Objects.equals(this.dob, passportVerificationResponseSchema.dob) && + Objects.equals(this.applicationType, passportVerificationResponseSchema.applicationType) && + Objects.equals(this.applicationReceivedDate, passportVerificationResponseSchema.applicationReceivedDate); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, status, fileNumber, name, dob, applicationType, applicationReceivedDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PassportVerificationResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" fileNumber: ").append(toIndentedString(fileNumber)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" applicationType: ").append(toIndentedString(applicationType)).append("\n"); + sb.append(" applicationReceivedDate: ").append(toIndentedString(applicationReceivedDate)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("status"); + openapiFields.add("file_number"); + openapiFields.add("name"); + openapiFields.add("dob"); + openapiFields.add("application_type"); + openapiFields.add("application_received_date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PassportVerificationResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("file_number") != null && !jsonObj.get("file_number").isJsonNull()) && !jsonObj.get("file_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_number").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("application_type") != null && !jsonObj.get("application_type").isJsonNull()) && !jsonObj.get("application_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_type").toString())); + } + if ((jsonObj.get("application_received_date") != null && !jsonObj.get("application_received_date").isJsonNull()) && !jsonObj.get("application_received_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application_received_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_received_date").toString())); + } + } + + + /** + * 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 PassportVerificationResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("file_number") != null && !jsonObj.get("file_number").isJsonNull()) && !jsonObj.get("file_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_number").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("application_type") != null && !jsonObj.get("application_type").isJsonNull()) && !jsonObj.get("application_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_type").toString())); + } + if ((jsonObj.get("application_received_date") != null && !jsonObj.get("application_received_date").isJsonNull()) && !jsonObj.get("application_received_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application_received_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_received_date").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PassportVerificationResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PassportVerificationResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PassportVerificationResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PassportVerificationResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PassportVerificationResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PassportVerificationResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PassportVerificationResponseSchema + * @throws IOException if the JSON string is invalid with respect to PassportVerificationResponseSchema + */ + public static PassportVerificationResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PassportVerificationResponseSchema.class); + } + + /** + * Convert an instance of PassportVerificationResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/PostPanBulkResponseSchema.java b/src/main/java/com/cashfree/model/PostPanBulkResponseSchema.java new file mode 100644 index 0000000..8fcbf26 --- /dev/null +++ b/src/main/java/com/cashfree/model/PostPanBulkResponseSchema.java @@ -0,0 +1,245 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response for verifying a large number of PAN information + */ +@Schema(description = "Success response for verifying a large number of PAN information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class PostPanBulkResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Long referenceId; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public PostPanBulkResponseSchema() { + } + + public PostPanBulkResponseSchema referenceId(Long referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "612", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Long getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Long referenceId) { + this.referenceId = referenceId; + } + + + public PostPanBulkResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "Request accepted. You can check the status after some time.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostPanBulkResponseSchema postPanBulkResponseSchema = (PostPanBulkResponseSchema) o; + return Objects.equals(this.referenceId, postPanBulkResponseSchema.referenceId) && + Objects.equals(this.message, postPanBulkResponseSchema.message); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostPanBulkResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 PostPanBulkResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 PostPanBulkResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PostPanBulkResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PostPanBulkResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PostPanBulkResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PostPanBulkResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PostPanBulkResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PostPanBulkResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PostPanBulkResponseSchema + * @throws IOException if the JSON string is invalid with respect to PostPanBulkResponseSchema + */ + public static PostPanBulkResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PostPanBulkResponseSchema.class); + } + + /** + * Convert an instance of PostPanBulkResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ReverseGeocodingRequestSchema.java b/src/main/java/com/cashfree/model/ReverseGeocodingRequestSchema.java new file mode 100644 index 0000000..d96e16a --- /dev/null +++ b/src/main/java/com/cashfree/model/ReverseGeocodingRequestSchema.java @@ -0,0 +1,303 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to convert geographic cooridnates into readable location + */ +@Schema(description = "Find the request parameters to convert geographic cooridnates into readable location") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ReverseGeocodingRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "test001"; + + public static final String SERIALIZED_NAME_LATITUDE = "latitude"; + @SerializedName(SERIALIZED_NAME_LATITUDE) + private String latitude = "12.9274477"; + + public static final String SERIALIZED_NAME_LONGITUDE = "longitude"; + @SerializedName(SERIALIZED_NAME_LONGITUDE) + private String longitude = "77.6326542"; + + public ReverseGeocodingRequestSchema() { + } + + public ReverseGeocodingRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "test001", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public ReverseGeocodingRequestSchema latitude(String latitude) { + + this.latitude = latitude; + return this; + } + + /** + * It is the angular distance expressed in degrees of arc north or south of the equator to specify the location. + * @return latitude + **/ + @javax.annotation.Nonnull + @Schema(example = "12.9274477", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the angular distance expressed in degrees of arc north or south of the equator to specify the location.") + public String getLatitude() { + return latitude; + } + + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + + public ReverseGeocodingRequestSchema longitude(String longitude) { + + this.longitude = longitude; + return this; + } + + /** + * It is the angular distance expressed in degrees of arc east or west of the equator to specify the location. + * @return longitude + **/ + @javax.annotation.Nonnull + @Schema(example = "77.6326542", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the angular distance expressed in degrees of arc east or west of the equator to specify the location.") + public String getLongitude() { + return longitude; + } + + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseGeocodingRequestSchema reverseGeocodingRequestSchema = (ReverseGeocodingRequestSchema) o; + return Objects.equals(this.verificationId, reverseGeocodingRequestSchema.verificationId) && + Objects.equals(this.latitude, reverseGeocodingRequestSchema.latitude) && + Objects.equals(this.longitude, reverseGeocodingRequestSchema.longitude); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, latitude, longitude); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseGeocodingRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n"); + sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("latitude"); + openapiFields.add("longitude"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("latitude"); + openapiRequiredFields.add("longitude"); + } + + /** + * 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 ReverseGeocodingRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseGeocodingRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("latitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `latitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latitude").toString())); + } + if (!jsonObj.get("longitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longitude").toString())); + } + } + + + /** + * 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 ReverseGeocodingRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseGeocodingRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("latitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `latitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latitude").toString())); + } + if (!jsonObj.get("longitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longitude").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseGeocodingRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseGeocodingRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReverseGeocodingRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseGeocodingRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseGeocodingRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseGeocodingRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseGeocodingRequestSchema + * @throws IOException if the JSON string is invalid with respect to ReverseGeocodingRequestSchema + */ + public static ReverseGeocodingRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseGeocodingRequestSchema.class); + } + + /** + * Convert an instance of ReverseGeocodingRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ReverseGeocodingResponseSchema.java b/src/main/java/com/cashfree/model/ReverseGeocodingResponseSchema.java new file mode 100644 index 0000000..5a710b6 --- /dev/null +++ b/src/main/java/com/cashfree/model/ReverseGeocodingResponseSchema.java @@ -0,0 +1,590 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Reverse Geocoding success response + */ +@Schema(description = "Reverse Geocoding success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ReverseGeocodingResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_LATITUDE = "latitude"; + @SerializedName(SERIALIZED_NAME_LATITUDE) + private String latitude; + + public static final String SERIALIZED_NAME_LONGITUDE = "longitude"; + @SerializedName(SERIALIZED_NAME_LONGITUDE) + private String longitude; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_STATECODE = "statecode"; + @SerializedName(SERIALIZED_NAME_STATECODE) + private String statecode; + + public static final String SERIALIZED_NAME_COUNTRYCODE = "countrycode"; + @SerializedName(SERIALIZED_NAME_COUNTRYCODE) + private String countrycode; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + private BigDecimal score; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public ReverseGeocodingResponseSchema() { + } + + public ReverseGeocodingResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "21637861", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public ReverseGeocodingResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "test001", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public ReverseGeocodingResponseSchema latitude(String latitude) { + + this.latitude = latitude; + return this; + } + + /** + * It displays the entered angular distance expressed in degrees of arc north or south of the equator to specify the location. + * @return latitude + **/ + @javax.annotation.Nullable + @Schema(example = "12.9274477", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the entered angular distance expressed in degrees of arc north or south of the equator to specify the location.") + public String getLatitude() { + return latitude; + } + + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + + public ReverseGeocodingResponseSchema longitude(String longitude) { + + this.longitude = longitude; + return this; + } + + /** + * It displays the entered angular distance expressed in degrees of arc east or west of the equator to specify the location. + * @return longitude + **/ + @javax.annotation.Nullable + @Schema(example = "77.6326542", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the entered angular distance expressed in degrees of arc east or west of the equator to specify the location.") + public String getLongitude() { + return longitude; + } + + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + + public ReverseGeocodingResponseSchema address(String address) { + + this.address = address; + return this; + } + + /** + * It displays the physical address of the entered coordinates. + * @return address + **/ + @javax.annotation.Nullable + @Schema(example = "JSS Institutions Campus, First Floor, CA Site No.1, HAL 3rd Stage, HAL 3rd Stage, KodihalliBehind Hotel Leela Palace, HAL 2nd Stage, Kodihalli, Bengaluru, Karnataka 560008, India", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the physical address of the entered coordinates.") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public ReverseGeocodingResponseSchema city(String city) { + + this.city = city; + return this; + } + + /** + * It displays the name of the city of the entered coordinates. + * @return city + **/ + @javax.annotation.Nullable + @Schema(example = "bangalore", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the city of the entered coordinates.") + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + public ReverseGeocodingResponseSchema state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the name of the state of the entered coordinates. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "Karnataka", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state of the entered coordinates.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public ReverseGeocodingResponseSchema statecode(String statecode) { + + this.statecode = statecode; + return this; + } + + /** + * It displays the state's code of the entered coordinates. + * @return statecode + **/ + @javax.annotation.Nullable + @Schema(example = "KA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the state's code of the entered coordinates.") + public String getStatecode() { + return statecode; + } + + + public void setStatecode(String statecode) { + this.statecode = statecode; + } + + + public ReverseGeocodingResponseSchema countrycode(String countrycode) { + + this.countrycode = countrycode; + return this; + } + + /** + * It displays the country's code of the entered coordinates. + * @return countrycode + **/ + @javax.annotation.Nullable + @Schema(example = "In", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the country's code of the entered coordinates.") + public String getCountrycode() { + return countrycode; + } + + + public void setCountrycode(String countrycode) { + this.countrycode = countrycode; + } + + + public ReverseGeocodingResponseSchema pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code information of the entered coordinates. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "560008", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code information of the entered coordinates.") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public ReverseGeocodingResponseSchema score(BigDecimal score) { + + this.score = score; + return this; + } + + /** + * + * @return score + **/ + @javax.annotation.Nullable + @Schema(example = "1", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public BigDecimal getScore() { + return score; + } + + + public void setScore(BigDecimal score) { + this.score = score; + } + + + public ReverseGeocodingResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the entered coordinates. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the entered coordinates.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseGeocodingResponseSchema reverseGeocodingResponseSchema = (ReverseGeocodingResponseSchema) o; + return Objects.equals(this.referenceId, reverseGeocodingResponseSchema.referenceId) && + Objects.equals(this.verificationId, reverseGeocodingResponseSchema.verificationId) && + Objects.equals(this.latitude, reverseGeocodingResponseSchema.latitude) && + Objects.equals(this.longitude, reverseGeocodingResponseSchema.longitude) && + Objects.equals(this.address, reverseGeocodingResponseSchema.address) && + Objects.equals(this.city, reverseGeocodingResponseSchema.city) && + Objects.equals(this.state, reverseGeocodingResponseSchema.state) && + Objects.equals(this.statecode, reverseGeocodingResponseSchema.statecode) && + Objects.equals(this.countrycode, reverseGeocodingResponseSchema.countrycode) && + Objects.equals(this.pincode, reverseGeocodingResponseSchema.pincode) && + Objects.equals(this.score, reverseGeocodingResponseSchema.score) && + Objects.equals(this.status, reverseGeocodingResponseSchema.status); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, latitude, longitude, address, city, state, statecode, countrycode, pincode, score, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseGeocodingResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n"); + sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" statecode: ").append(toIndentedString(statecode)).append("\n"); + sb.append(" countrycode: ").append(toIndentedString(countrycode)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("latitude"); + openapiFields.add("longitude"); + openapiFields.add("address"); + openapiFields.add("city"); + openapiFields.add("state"); + openapiFields.add("statecode"); + openapiFields.add("countrycode"); + openapiFields.add("pincode"); + openapiFields.add("score"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 ReverseGeocodingResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("latitude") != null && !jsonObj.get("latitude").isJsonNull()) && !jsonObj.get("latitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `latitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latitude").toString())); + } + if ((jsonObj.get("longitude") != null && !jsonObj.get("longitude").isJsonNull()) && !jsonObj.get("longitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longitude").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull()) && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("statecode") != null && !jsonObj.get("statecode").isJsonNull()) && !jsonObj.get("statecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `statecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statecode").toString())); + } + if ((jsonObj.get("countrycode") != null && !jsonObj.get("countrycode").isJsonNull()) && !jsonObj.get("countrycode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `countrycode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countrycode").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + + /** + * 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 ReverseGeocodingResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("latitude") != null && !jsonObj.get("latitude").isJsonNull()) && !jsonObj.get("latitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `latitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latitude").toString())); + } + if ((jsonObj.get("longitude") != null && !jsonObj.get("longitude").isJsonNull()) && !jsonObj.get("longitude").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longitude").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull()) && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("statecode") != null && !jsonObj.get("statecode").isJsonNull()) && !jsonObj.get("statecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `statecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statecode").toString())); + } + if ((jsonObj.get("countrycode") != null && !jsonObj.get("countrycode").isJsonNull()) && !jsonObj.get("countrycode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `countrycode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countrycode").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseGeocodingResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseGeocodingResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReverseGeocodingResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseGeocodingResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseGeocodingResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseGeocodingResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseGeocodingResponseSchema + * @throws IOException if the JSON string is invalid with respect to ReverseGeocodingResponseSchema + */ + public static ReverseGeocodingResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseGeocodingResponseSchema.class); + } + + /** + * Convert an instance of ReverseGeocodingResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SplitAddress.java b/src/main/java/com/cashfree/model/SplitAddress.java new file mode 100644 index 0000000..cd7d5ff --- /dev/null +++ b/src/main/java/com/cashfree/model/SplitAddress.java @@ -0,0 +1,433 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It containts the address information in individual components. + */ +@Schema(description = "It containts the address information in individual components.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class SplitAddress { + public static final String SERIALIZED_NAME_DISTRICT = "district"; + @SerializedName(SERIALIZED_NAME_DISTRICT) + private List district; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private List> state; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private List city; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private List country; + + public static final String SERIALIZED_NAME_ADDRESS_LINE = "address_line"; + @SerializedName(SERIALIZED_NAME_ADDRESS_LINE) + private String addressLine; + + public SplitAddress() { + } + + public SplitAddress district(List district) { + + this.district = district; + return this; + } + + public SplitAddress addDistrictItem(String districtItem) { + if (this.district == null) { + this.district = new ArrayList<>(); + } + this.district.add(districtItem); + return this; + } + + /** + * Get district + * @return district + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getDistrict() { + return district; + } + + + public void setDistrict(List district) { + this.district = district; + } + + + public SplitAddress state(List> state) { + + this.state = state; + return this; + } + + public SplitAddress addStateItem(List stateItem) { + if (this.state == null) { + this.state = new ArrayList<>(); + } + this.state.add(stateItem); + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List> getState() { + return state; + } + + + public void setState(List> state) { + this.state = state; + } + + + public SplitAddress city(List city) { + + this.city = city; + return this; + } + + public SplitAddress addCityItem(String cityItem) { + if (this.city == null) { + this.city = new ArrayList<>(); + } + this.city.add(cityItem); + return this; + } + + /** + * Get city + * @return city + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getCity() { + return city; + } + + + public void setCity(List city) { + this.city = city; + } + + + public SplitAddress pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * Get pincode + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "560103", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public SplitAddress country(List country) { + + this.country = country; + return this; + } + + public SplitAddress addCountryItem(String countryItem) { + if (this.country == null) { + this.country = new ArrayList<>(); + } + this.country.add(countryItem); + return this; + } + + /** + * Get country + * @return country + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public List getCountry() { + return country; + } + + + public void setCountry(List country) { + this.country = country; + } + + + public SplitAddress addressLine(String addressLine) { + + this.addressLine = addressLine; + return this; + } + + /** + * Get addressLine + * @return addressLine + **/ + @javax.annotation.Nullable + @Schema(example = "FLAT 901 A BLOCK GOYAL ORCHID,LAKE VIEW APTS KARIAGRAHARA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getAddressLine() { + return addressLine; + } + + + public void setAddressLine(String addressLine) { + this.addressLine = addressLine; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SplitAddress splitAddress = (SplitAddress) o; + return Objects.equals(this.district, splitAddress.district) && + Objects.equals(this.state, splitAddress.state) && + Objects.equals(this.city, splitAddress.city) && + Objects.equals(this.pincode, splitAddress.pincode) && + Objects.equals(this.country, splitAddress.country) && + Objects.equals(this.addressLine, splitAddress.addressLine); + } + + @Override + public int hashCode() { + return Objects.hash(district, state, city, pincode, country, addressLine); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SplitAddress {\n"); + sb.append(" district: ").append(toIndentedString(district)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" addressLine: ").append(toIndentedString(addressLine)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("district"); + openapiFields.add("state"); + openapiFields.add("city"); + openapiFields.add("pincode"); + openapiFields.add("country"); + openapiFields.add("address_line"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 SplitAddress + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + } + + + /** + * 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 SplitAddress + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SplitAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SplitAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SplitAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SplitAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SplitAddress read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SplitAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of SplitAddress + * @throws IOException if the JSON string is invalid with respect to SplitAddress + */ + public static SplitAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SplitAddress.class); + } + + /** + * Convert an instance of SplitAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SplitAddressSchema.java b/src/main/java/com/cashfree/model/SplitAddressSchema.java new file mode 100644 index 0000000..6cc2242 --- /dev/null +++ b/src/main/java/com/cashfree/model/SplitAddressSchema.java @@ -0,0 +1,433 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the address information of the individual as present in the voter ID card. + */ +@Schema(description = "It contains the address information of the individual as present in the voter ID card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class SplitAddressSchema { + public static final String SERIALIZED_NAME_DISTRICT = "district"; + @SerializedName(SERIALIZED_NAME_DISTRICT) + private List district; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private List> state; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private List city; + + public static final String SERIALIZED_NAME_PINCODE = "pincode"; + @SerializedName(SERIALIZED_NAME_PINCODE) + private String pincode; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private List country; + + public static final String SERIALIZED_NAME_ADDRESS_LINE = "address_line"; + @SerializedName(SERIALIZED_NAME_ADDRESS_LINE) + private String addressLine; + + public SplitAddressSchema() { + } + + public SplitAddressSchema district(List district) { + + this.district = district; + return this; + } + + public SplitAddressSchema addDistrictItem(String districtItem) { + if (this.district == null) { + this.district = new ArrayList<>(); + } + this.district.add(districtItem); + return this; + } + + /** + * It displays the name of the district as present in the address information of the voter ID card. + * @return district + **/ + @javax.annotation.Nullable + @Schema(example = "[\"RAICHUR\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the district as present in the address information of the voter ID card.") + public List getDistrict() { + return district; + } + + + public void setDistrict(List district) { + this.district = district; + } + + + public SplitAddressSchema state(List> state) { + + this.state = state; + return this; + } + + public SplitAddressSchema addStateItem(List stateItem) { + if (this.state == null) { + this.state = new ArrayList<>(); + } + this.state.add(stateItem); + return this; + } + + /** + * It displays the name of the state as present in the address information of the voter ID card. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "[[\"Karnataka\"]]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state as present in the address information of the voter ID card.") + public List> getState() { + return state; + } + + + public void setState(List> state) { + this.state = state; + } + + + public SplitAddressSchema city(List city) { + + this.city = city; + return this; + } + + public SplitAddressSchema addCityItem(String cityItem) { + if (this.city == null) { + this.city = new ArrayList<>(); + } + this.city.add(cityItem); + return this; + } + + /** + * It displays the name of the city as present in the voter ID card. + * @return city + **/ + @javax.annotation.Nullable + @Schema(example = "[\"Manvi\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the city as present in the voter ID card.") + public List getCity() { + return city; + } + + + public void setCity(List city) { + this.city = city; + } + + + public SplitAddressSchema pincode(String pincode) { + + this.pincode = pincode; + return this; + } + + /** + * It displays the PIN code information as present in the voter ID card. + * @return pincode + **/ + @javax.annotation.Nullable + @Schema(example = "560034", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the PIN code information as present in the voter ID card.") + public String getPincode() { + return pincode; + } + + + public void setPincode(String pincode) { + this.pincode = pincode; + } + + + public SplitAddressSchema country(List country) { + + this.country = country; + return this; + } + + public SplitAddressSchema addCountryItem(String countryItem) { + if (this.country == null) { + this.country = new ArrayList<>(); + } + this.country.add(countryItem); + return this; + } + + /** + * It displays the name of the country as present in the voter ID card. + * @return country + **/ + @javax.annotation.Nullable + @Schema(example = "[\"IN\",\"IND\",\"INDIA\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the country as present in the voter ID card.") + public List getCountry() { + return country; + } + + + public void setCountry(List country) { + this.country = country; + } + + + public SplitAddressSchema addressLine(String addressLine) { + + this.addressLine = addressLine; + return this; + } + + /** + * It displays the address information as present in the voter ID card. + * @return addressLine + **/ + @javax.annotation.Nullable + @Schema(example = "GOVT JUNIOR COLLEGE SIRWAR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address information as present in the voter ID card.") + public String getAddressLine() { + return addressLine; + } + + + public void setAddressLine(String addressLine) { + this.addressLine = addressLine; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SplitAddressSchema splitAddressSchema = (SplitAddressSchema) o; + return Objects.equals(this.district, splitAddressSchema.district) && + Objects.equals(this.state, splitAddressSchema.state) && + Objects.equals(this.city, splitAddressSchema.city) && + Objects.equals(this.pincode, splitAddressSchema.pincode) && + Objects.equals(this.country, splitAddressSchema.country) && + Objects.equals(this.addressLine, splitAddressSchema.addressLine); + } + + @Override + public int hashCode() { + return Objects.hash(district, state, city, pincode, country, addressLine); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SplitAddressSchema {\n"); + sb.append(" district: ").append(toIndentedString(district)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" pincode: ").append(toIndentedString(pincode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" addressLine: ").append(toIndentedString(addressLine)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("district"); + openapiFields.add("state"); + openapiFields.add("city"); + openapiFields.add("pincode"); + openapiFields.add("country"); + openapiFields.add("address_line"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 SplitAddressSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + } + + + /** + * 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 SplitAddressSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("district") != null && !jsonObj.get("district").isJsonNull() && !jsonObj.get("district").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `district` to be an array in the JSON string but got `%s`", jsonObj.get("district").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull() && !jsonObj.get("state").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be an array in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull() && !jsonObj.get("city").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be an array in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("pincode") != null && !jsonObj.get("pincode").isJsonNull()) && !jsonObj.get("pincode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pincode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pincode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull() && !jsonObj.get("country").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be an array in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("address_line") != null && !jsonObj.get("address_line").isJsonNull()) && !jsonObj.get("address_line").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address_line` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_line").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SplitAddressSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SplitAddressSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SplitAddressSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SplitAddressSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SplitAddressSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SplitAddressSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of SplitAddressSchema + * @throws IOException if the JSON string is invalid with respect to SplitAddressSchema + */ + public static SplitAddressSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SplitAddressSchema.class); + } + + /** + * Convert an instance of SplitAddressSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/UpiAdvanceRequestSchema.java b/src/main/java/com/cashfree/model/UpiAdvanceRequestSchema.java new file mode 100644 index 0000000..0c22dd2 --- /dev/null +++ b/src/main/java/com/cashfree/model/UpiAdvanceRequestSchema.java @@ -0,0 +1,266 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify UPI VPA information + */ +@Schema(description = "Find the request parameters to verify UPI VPA information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class UpiAdvanceRequestSchema { + public static final String SERIALIZED_NAME_VPA = "vpa"; + @SerializedName(SERIALIZED_NAME_VPA) + private String vpa = "valid_vpa@upi"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "John Doe"; + + public UpiAdvanceRequestSchema() { + } + + public UpiAdvanceRequestSchema vpa(String vpa) { + + this.vpa = vpa; + return this; + } + + /** + * It is the UPI VPA information. Only alphanumeric characters with period (.), hyphen (-), and underscore ( _ ), at the rate of (@) are allowed. + * @return vpa + **/ + @javax.annotation.Nonnull + @Schema(example = "valid_vpa@upi", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the UPI VPA information. Only alphanumeric characters with period (.), hyphen (-), and underscore ( _ ), at the rate of (@) are allowed.") + public String getVpa() { + return vpa; + } + + + public void setVpa(String vpa) { + this.vpa = vpa; + } + + + public UpiAdvanceRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the UPI VPA account holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the UPI VPA account holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpiAdvanceRequestSchema upiAdvanceRequestSchema = (UpiAdvanceRequestSchema) o; + return Objects.equals(this.vpa, upiAdvanceRequestSchema.vpa) && + Objects.equals(this.name, upiAdvanceRequestSchema.name); + } + + @Override + public int hashCode() { + return Objects.hash(vpa, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpiAdvanceRequestSchema {\n"); + sb.append(" vpa: ").append(toIndentedString(vpa)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("vpa"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("vpa"); + } + + /** + * 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 UpiAdvanceRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpiAdvanceRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("vpa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vpa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vpa").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + + /** + * 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 UpiAdvanceRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpiAdvanceRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("vpa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vpa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vpa").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpiAdvanceRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpiAdvanceRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpiAdvanceRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpiAdvanceRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpiAdvanceRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpiAdvanceRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpiAdvanceRequestSchema + * @throws IOException if the JSON string is invalid with respect to UpiAdvanceRequestSchema + */ + public static UpiAdvanceRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpiAdvanceRequestSchema.class); + } + + /** + * Convert an instance of UpiAdvanceRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/UpiAdvanceResponseSchema.java b/src/main/java/com/cashfree/model/UpiAdvanceResponseSchema.java new file mode 100644 index 0000000..1173e9b --- /dev/null +++ b/src/main/java/com/cashfree/model/UpiAdvanceResponseSchema.java @@ -0,0 +1,385 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * UPI 360 success response + */ +@Schema(description = "UPI 360 success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class UpiAdvanceResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_IFSC = "ifsc"; + @SerializedName(SERIALIZED_NAME_IFSC) + private String ifsc; + + public static final String SERIALIZED_NAME_VPA = "vpa"; + @SerializedName(SERIALIZED_NAME_VPA) + private String vpa; + + public static final String SERIALIZED_NAME_NAME_AT_BANK = "name_at_bank"; + @SerializedName(SERIALIZED_NAME_NAME_AT_BANK) + private String nameAtBank; + + public UpiAdvanceResponseSchema() { + } + + public UpiAdvanceResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public UpiAdvanceResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the UPI VPA information. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the UPI VPA information.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public UpiAdvanceResponseSchema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request. + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "Vpa verified successfully", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request.") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public UpiAdvanceResponseSchema ifsc(String ifsc) { + + this.ifsc = ifsc; + return this; + } + + /** + * It displays the IFSC information associated with the UPI VPA information. + * @return ifsc + **/ + @javax.annotation.Nullable + @Schema(example = "ICIC0006567", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the IFSC information associated with the UPI VPA information.") + public String getIfsc() { + return ifsc; + } + + + public void setIfsc(String ifsc) { + this.ifsc = ifsc; + } + + + public UpiAdvanceResponseSchema vpa(String vpa) { + + this.vpa = vpa; + return this; + } + + /** + * It displays the UPI VPA information. + * @return vpa + **/ + @javax.annotation.Nullable + @Schema(example = "success@upi", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the UPI VPA information.") + public String getVpa() { + return vpa; + } + + + public void setVpa(String vpa) { + this.vpa = vpa; + } + + + public UpiAdvanceResponseSchema nameAtBank(String nameAtBank) { + + this.nameAtBank = nameAtBank; + return this; + } + + /** + * It displays the name of the account holder as registered in the bank records. + * @return nameAtBank + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the account holder as registered in the bank records.") + public String getNameAtBank() { + return nameAtBank; + } + + + public void setNameAtBank(String nameAtBank) { + this.nameAtBank = nameAtBank; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpiAdvanceResponseSchema upiAdvanceResponseSchema = (UpiAdvanceResponseSchema) o; + return Objects.equals(this.referenceId, upiAdvanceResponseSchema.referenceId) && + Objects.equals(this.status, upiAdvanceResponseSchema.status) && + Objects.equals(this.message, upiAdvanceResponseSchema.message) && + Objects.equals(this.ifsc, upiAdvanceResponseSchema.ifsc) && + Objects.equals(this.vpa, upiAdvanceResponseSchema.vpa) && + Objects.equals(this.nameAtBank, upiAdvanceResponseSchema.nameAtBank); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, status, message, ifsc, vpa, nameAtBank); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpiAdvanceResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" ifsc: ").append(toIndentedString(ifsc)).append("\n"); + sb.append(" vpa: ").append(toIndentedString(vpa)).append("\n"); + sb.append(" nameAtBank: ").append(toIndentedString(nameAtBank)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("status"); + openapiFields.add("message"); + openapiFields.add("ifsc"); + openapiFields.add("vpa"); + openapiFields.add("name_at_bank"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 UpiAdvanceResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("ifsc") != null && !jsonObj.get("ifsc").isJsonNull()) && !jsonObj.get("ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ifsc").toString())); + } + if ((jsonObj.get("vpa") != null && !jsonObj.get("vpa").isJsonNull()) && !jsonObj.get("vpa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vpa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vpa").toString())); + } + if ((jsonObj.get("name_at_bank") != null && !jsonObj.get("name_at_bank").isJsonNull()) && !jsonObj.get("name_at_bank").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_at_bank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_at_bank").toString())); + } + } + + + /** + * 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 UpiAdvanceResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("ifsc") != null && !jsonObj.get("ifsc").isJsonNull()) && !jsonObj.get("ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ifsc").toString())); + } + if ((jsonObj.get("vpa") != null && !jsonObj.get("vpa").isJsonNull()) && !jsonObj.get("vpa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vpa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vpa").toString())); + } + if ((jsonObj.get("name_at_bank") != null && !jsonObj.get("name_at_bank").isJsonNull()) && !jsonObj.get("name_at_bank").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_at_bank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_at_bank").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpiAdvanceResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpiAdvanceResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpiAdvanceResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpiAdvanceResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpiAdvanceResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpiAdvanceResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpiAdvanceResponseSchema + * @throws IOException if the JSON string is invalid with respect to UpiAdvanceResponseSchema + */ + public static UpiAdvanceResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpiAdvanceResponseSchema.class); + } + + /** + * Convert an instance of UpiAdvanceResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/UpiMobileRequestSchema.java b/src/main/java/com/cashfree/model/UpiMobileRequestSchema.java new file mode 100644 index 0000000..390802a --- /dev/null +++ b/src/main/java/com/cashfree/model/UpiMobileRequestSchema.java @@ -0,0 +1,337 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to fetch the list of UPI VPA + */ +@Schema(description = "Find the request parameters to fetch the list of UPI VPA") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class UpiMobileRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "test_verification_id"; + + public static final String SERIALIZED_NAME_MOBILE_NUMBER = "mobile_number"; + @SerializedName(SERIALIZED_NAME_MOBILE_NUMBER) + private String mobileNumber = "6666666666"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "John Doe"; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email = "JohnDoe@gmail.com"; + + public UpiMobileRequestSchema() { + } + + public UpiMobileRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphaumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "test_verification_id", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphaumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public UpiMobileRequestSchema mobileNumber(String mobileNumber) { + + this.mobileNumber = mobileNumber; + return this; + } + + /** + * It is the mobile number of the UPI VPA account holder. + * @return mobileNumber + **/ + @javax.annotation.Nonnull + @Schema(example = "6666666666", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the mobile number of the UPI VPA account holder.") + public String getMobileNumber() { + return mobileNumber; + } + + + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber; + } + + + public UpiMobileRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the account holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the account holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpiMobileRequestSchema email(String email) { + + this.email = email; + return this; + } + + /** + * It is the email ID of the account holder. + * @return email + **/ + @javax.annotation.Nullable + @Schema(example = "JohnDoe@gmail.com", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the email ID of the account holder.") + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpiMobileRequestSchema upiMobileRequestSchema = (UpiMobileRequestSchema) o; + return Objects.equals(this.verificationId, upiMobileRequestSchema.verificationId) && + Objects.equals(this.mobileNumber, upiMobileRequestSchema.mobileNumber) && + Objects.equals(this.name, upiMobileRequestSchema.name) && + Objects.equals(this.email, upiMobileRequestSchema.email); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, mobileNumber, name, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpiMobileRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" mobileNumber: ").append(toIndentedString(mobileNumber)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("mobile_number"); + openapiFields.add("name"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("mobile_number"); + } + + /** + * 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 UpiMobileRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpiMobileRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + + /** + * 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 UpiMobileRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpiMobileRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpiMobileRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpiMobileRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpiMobileRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpiMobileRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpiMobileRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpiMobileRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpiMobileRequestSchema + * @throws IOException if the JSON string is invalid with respect to UpiMobileRequestSchema + */ + public static UpiMobileRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpiMobileRequestSchema.class); + } + + /** + * Convert an instance of UpiMobileRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/UpiMobileResponseSchema.java b/src/main/java/com/cashfree/model/UpiMobileResponseSchema.java new file mode 100644 index 0000000..4000087 --- /dev/null +++ b/src/main/java/com/cashfree/model/UpiMobileResponseSchema.java @@ -0,0 +1,467 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Success response + */ +@Schema(description = "Success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class UpiMobileResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_ACCOUNT_STATUS = "account_status"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_STATUS) + private String accountStatus; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_MOBILE_NUMBER = "mobile_number"; + @SerializedName(SERIALIZED_NAME_MOBILE_NUMBER) + private String mobileNumber; + + public static final String SERIALIZED_NAME_VPA = "vpa"; + @SerializedName(SERIALIZED_NAME_VPA) + private String vpa; + + public static final String SERIALIZED_NAME_NAME_AT_BANK = "name_at_bank"; + @SerializedName(SERIALIZED_NAME_NAME_AT_BANK) + private String nameAtBank; + + public static final String SERIALIZED_NAME_ADDITIONAL_VPAS = "additional_vpas"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_VPAS) + private List additionalVpas; + + public UpiMobileResponseSchema() { + } + + public UpiMobileResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public UpiMobileResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "SUCCESS", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public UpiMobileResponseSchema accountStatus(String accountStatus) { + + this.accountStatus = accountStatus; + return this; + } + + /** + * It displays the status of the UPI VPA information. + * @return accountStatus + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the UPI VPA information.") + public String getAccountStatus() { + return accountStatus; + } + + + public void setAccountStatus(String accountStatus) { + this.accountStatus = accountStatus; + } + + + public UpiMobileResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "test_verification_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public UpiMobileResponseSchema mobileNumber(String mobileNumber) { + + this.mobileNumber = mobileNumber; + return this; + } + + /** + * It displays the mobile number of the account holder. + * @return mobileNumber + **/ + @javax.annotation.Nullable + @Schema(example = "6666666666", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the mobile number of the account holder.") + public String getMobileNumber() { + return mobileNumber; + } + + + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber; + } + + + public UpiMobileResponseSchema vpa(String vpa) { + + this.vpa = vpa; + return this; + } + + /** + * It displays the UPI VPA associated with the entered mobile number. If no primary UPI VPA is associated, tis field will be null. + * @return vpa + **/ + @javax.annotation.Nullable + @Schema(example = "johndoe@oksbi", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the UPI VPA associated with the entered mobile number. If no primary UPI VPA is associated, tis field will be null.") + public String getVpa() { + return vpa; + } + + + public void setVpa(String vpa) { + this.vpa = vpa; + } + + + public UpiMobileResponseSchema nameAtBank(String nameAtBank) { + + this.nameAtBank = nameAtBank; + return this; + } + + /** + * It displays the name of the account holder as registered in the bank. If no primary UPI VPA is associated, this field will be null. + * @return nameAtBank + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the account holder as registered in the bank. If no primary UPI VPA is associated, this field will be null.") + public String getNameAtBank() { + return nameAtBank; + } + + + public void setNameAtBank(String nameAtBank) { + this.nameAtBank = nameAtBank; + } + + + public UpiMobileResponseSchema additionalVpas(List additionalVpas) { + + this.additionalVpas = additionalVpas; + return this; + } + + public UpiMobileResponseSchema addAdditionalVpasItem(String additionalVpasItem) { + if (this.additionalVpas == null) { + this.additionalVpas = new ArrayList<>(); + } + this.additionalVpas.add(additionalVpasItem); + return this; + } + + /** + * It displays the list of additional UPI VPA associated with the mobile number. If no other UPI VPA is linked with the mobile number, this will be an empty array []. + * @return additionalVpas + **/ + @javax.annotation.Nullable + @Schema(example = "[\"6666666666@apl\",\"6666666666@paytm\"]", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the list of additional UPI VPA associated with the mobile number. If no other UPI VPA is linked with the mobile number, this will be an empty array [].") + public List getAdditionalVpas() { + return additionalVpas; + } + + + public void setAdditionalVpas(List additionalVpas) { + this.additionalVpas = additionalVpas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpiMobileResponseSchema upiMobileResponseSchema = (UpiMobileResponseSchema) o; + return Objects.equals(this.referenceId, upiMobileResponseSchema.referenceId) && + Objects.equals(this.status, upiMobileResponseSchema.status) && + Objects.equals(this.accountStatus, upiMobileResponseSchema.accountStatus) && + Objects.equals(this.verificationId, upiMobileResponseSchema.verificationId) && + Objects.equals(this.mobileNumber, upiMobileResponseSchema.mobileNumber) && + Objects.equals(this.vpa, upiMobileResponseSchema.vpa) && + Objects.equals(this.nameAtBank, upiMobileResponseSchema.nameAtBank) && + Objects.equals(this.additionalVpas, upiMobileResponseSchema.additionalVpas); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, status, accountStatus, verificationId, mobileNumber, vpa, nameAtBank, additionalVpas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpiMobileResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" accountStatus: ").append(toIndentedString(accountStatus)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" mobileNumber: ").append(toIndentedString(mobileNumber)).append("\n"); + sb.append(" vpa: ").append(toIndentedString(vpa)).append("\n"); + sb.append(" nameAtBank: ").append(toIndentedString(nameAtBank)).append("\n"); + sb.append(" additionalVpas: ").append(toIndentedString(additionalVpas)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("status"); + openapiFields.add("account_status"); + openapiFields.add("verification_id"); + openapiFields.add("mobile_number"); + openapiFields.add("vpa"); + openapiFields.add("name_at_bank"); + openapiFields.add("additional_vpas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 UpiMobileResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("account_status") != null && !jsonObj.get("account_status").isJsonNull()) && !jsonObj.get("account_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + if ((jsonObj.get("vpa") != null && !jsonObj.get("vpa").isJsonNull()) && !jsonObj.get("vpa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vpa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vpa").toString())); + } + if ((jsonObj.get("name_at_bank") != null && !jsonObj.get("name_at_bank").isJsonNull()) && !jsonObj.get("name_at_bank").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_at_bank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_at_bank").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("additional_vpas") != null && !jsonObj.get("additional_vpas").isJsonNull() && !jsonObj.get("additional_vpas").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `additional_vpas` to be an array in the JSON string but got `%s`", jsonObj.get("additional_vpas").toString())); + } + } + + + /** + * 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 UpiMobileResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("account_status") != null && !jsonObj.get("account_status").isJsonNull()) && !jsonObj.get("account_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + if ((jsonObj.get("vpa") != null && !jsonObj.get("vpa").isJsonNull()) && !jsonObj.get("vpa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vpa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vpa").toString())); + } + if ((jsonObj.get("name_at_bank") != null && !jsonObj.get("name_at_bank").isJsonNull()) && !jsonObj.get("name_at_bank").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_at_bank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_at_bank").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("additional_vpas") != null && !jsonObj.get("additional_vpas").isJsonNull() && !jsonObj.get("additional_vpas").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `additional_vpas` to be an array in the JSON string but got `%s`", jsonObj.get("additional_vpas").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpiMobileResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpiMobileResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpiMobileResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpiMobileResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpiMobileResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpiMobileResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpiMobileResponseSchema + * @throws IOException if the JSON string is invalid with respect to UpiMobileResponseSchema + */ + public static UpiMobileResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpiMobileResponseSchema.class); + } + + /** + * Convert an instance of UpiMobileResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/V2ErrorResponse404SchemaIpVerification.java b/src/main/java/com/cashfree/model/V2ErrorResponse404SchemaIpVerification.java new file mode 100644 index 0000000..c2b6e34 --- /dev/null +++ b/src/main/java/com/cashfree/model/V2ErrorResponse404SchemaIpVerification.java @@ -0,0 +1,286 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * IP not found error response + */ +@Schema(description = "IP not found error response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class V2ErrorResponse404SchemaIpVerification { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public V2ErrorResponse404SchemaIpVerification() { + } + + public V2ErrorResponse404SchemaIpVerification type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "not_found_error", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public V2ErrorResponse404SchemaIpVerification code(String code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @Schema(example = "not_found", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public V2ErrorResponse404SchemaIpVerification message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "unable to find IP details", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V2ErrorResponse404SchemaIpVerification v2ErrorResponse404SchemaIpVerification = (V2ErrorResponse404SchemaIpVerification) o; + return Objects.equals(this.type, v2ErrorResponse404SchemaIpVerification.type) && + Objects.equals(this.code, v2ErrorResponse404SchemaIpVerification.code) && + Objects.equals(this.message, v2ErrorResponse404SchemaIpVerification.message); + } + + @Override + public int hashCode() { + return Objects.hash(type, code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V2ErrorResponse404SchemaIpVerification {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("code"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 V2ErrorResponse404SchemaIpVerification + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 V2ErrorResponse404SchemaIpVerification + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!V2ErrorResponse404SchemaIpVerification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'V2ErrorResponse404SchemaIpVerification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(V2ErrorResponse404SchemaIpVerification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, V2ErrorResponse404SchemaIpVerification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public V2ErrorResponse404SchemaIpVerification read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of V2ErrorResponse404SchemaIpVerification given an JSON string + * + * @param jsonString JSON string + * @return An instance of V2ErrorResponse404SchemaIpVerification + * @throws IOException if the JSON string is invalid with respect to V2ErrorResponse404SchemaIpVerification + */ + public static V2ErrorResponse404SchemaIpVerification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, V2ErrorResponse404SchemaIpVerification.class); + } + + /** + * Convert an instance of V2ErrorResponse404SchemaIpVerification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ValidityDetails.java b/src/main/java/com/cashfree/model/ValidityDetails.java new file mode 100644 index 0000000..fddb783 --- /dev/null +++ b/src/main/java/com/cashfree/model/ValidityDetails.java @@ -0,0 +1,240 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.time.LocalDate; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * It contains the validity details. + */ +@Schema(description = "It contains the validity details.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class ValidityDetails { + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private LocalDate to; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private LocalDate from; + + public ValidityDetails() { + } + + public ValidityDetails to(LocalDate to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + @Schema(example = "Mon Oct 23 00:00:00 UTC 2023", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public LocalDate getTo() { + return to; + } + + + public void setTo(LocalDate to) { + this.to = to; + } + + + public ValidityDetails from(LocalDate from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + @Schema(example = "Mon Oct 23 00:00:00 UTC 2023", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public LocalDate getFrom() { + return from; + } + + + public void setFrom(LocalDate from) { + this.from = from; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidityDetails validityDetails = (ValidityDetails) o; + return Objects.equals(this.to, validityDetails.to) && + Objects.equals(this.from, validityDetails.from); + } + + @Override + public int hashCode() { + return Objects.hash(to, from); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidityDetails {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("to"); + openapiFields.add("from"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 ValidityDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + + /** + * 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 ValidityDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidityDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidityDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidityDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidityDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidityDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidityDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidityDetails + * @throws IOException if the JSON string is invalid with respect to ValidityDetails + */ + public static ValidityDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidityDetails.class); + } + + /** + * Convert an instance of ValidityDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/VehicleRcRequestSchema.java b/src/main/java/com/cashfree/model/VehicleRcRequestSchema.java new file mode 100644 index 0000000..9c06cd7 --- /dev/null +++ b/src/main/java/com/cashfree/model/VehicleRcRequestSchema.java @@ -0,0 +1,267 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request parameters to verify vehicle RC information + */ +@Schema(description = "Find the request parameters to verify vehicle RC information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class VehicleRcRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId = "test001"; + + public static final String SERIALIZED_NAME_VEHICLE_NUMBER = "vehicle_number"; + @SerializedName(SERIALIZED_NAME_VEHICLE_NUMBER) + private String vehicleNumber; + + public VehicleRcRequestSchema() { + } + + public VehicleRcRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed. + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "test001", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphanumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public VehicleRcRequestSchema vehicleNumber(String vehicleNumber) { + + this.vehicleNumber = vehicleNumber; + return this; + } + + /** + * It is the registration number of the vehicle + * @return vehicleNumber + **/ + @javax.annotation.Nonnull + @Schema(example = "PY01MW8769", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the registration number of the vehicle") + public String getVehicleNumber() { + return vehicleNumber; + } + + + public void setVehicleNumber(String vehicleNumber) { + this.vehicleNumber = vehicleNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VehicleRcRequestSchema vehicleRcRequestSchema = (VehicleRcRequestSchema) o; + return Objects.equals(this.verificationId, vehicleRcRequestSchema.verificationId) && + Objects.equals(this.vehicleNumber, vehicleRcRequestSchema.vehicleNumber); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, vehicleNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VehicleRcRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" vehicleNumber: ").append(toIndentedString(vehicleNumber)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("vehicle_number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("vehicle_number"); + } + + /** + * 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 VehicleRcRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VehicleRcRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("vehicle_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_number").toString())); + } + } + + + /** + * 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 VehicleRcRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VehicleRcRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("vehicle_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_number").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VehicleRcRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VehicleRcRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VehicleRcRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VehicleRcRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VehicleRcRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VehicleRcRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of VehicleRcRequestSchema + * @throws IOException if the JSON string is invalid with respect to VehicleRcRequestSchema + */ + public static VehicleRcRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VehicleRcRequestSchema.class); + } + + /** + * Convert an instance of VehicleRcRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/VehicleRcResponseSchema.java b/src/main/java/com/cashfree/model/VehicleRcResponseSchema.java new file mode 100644 index 0000000..9c71c4f --- /dev/null +++ b/src/main/java/com/cashfree/model/VehicleRcResponseSchema.java @@ -0,0 +1,2299 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.SplitAddress; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Verify Vehicle RC success response + */ +@Schema(description = "Verify Vehicle RC success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class VehicleRcResponseSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REG_NO = "reg_no"; + @SerializedName(SERIALIZED_NAME_REG_NO) + private String regNo; + + public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; + @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) + private String propertyClass; + + public static final String SERIALIZED_NAME_CHASSIS = "chassis"; + @SerializedName(SERIALIZED_NAME_CHASSIS) + private String chassis; + + public static final String SERIALIZED_NAME_ENGINE = "engine"; + @SerializedName(SERIALIZED_NAME_ENGINE) + private String engine; + + public static final String SERIALIZED_NAME_VEHICLE_MANUFACTURER_NAME = "vehicle_manufacturer_name"; + @SerializedName(SERIALIZED_NAME_VEHICLE_MANUFACTURER_NAME) + private String vehicleManufacturerName; + + public static final String SERIALIZED_NAME_MODEL = "model"; + @SerializedName(SERIALIZED_NAME_MODEL) + private String model; + + public static final String SERIALIZED_NAME_VEHICLE_COLOR = "vehicle_color"; + @SerializedName(SERIALIZED_NAME_VEHICLE_COLOR) + private String vehicleColor; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_NORMS_TYPE = "norms_type"; + @SerializedName(SERIALIZED_NAME_NORMS_TYPE) + private String normsType; + + public static final String SERIALIZED_NAME_BODY_TYPE = "body_type"; + @SerializedName(SERIALIZED_NAME_BODY_TYPE) + private String bodyType; + + public static final String SERIALIZED_NAME_OWNER_COUNT = "owner_count"; + @SerializedName(SERIALIZED_NAME_OWNER_COUNT) + private String ownerCount; + + public static final String SERIALIZED_NAME_OWNER = "owner"; + @SerializedName(SERIALIZED_NAME_OWNER) + private String owner; + + public static final String SERIALIZED_NAME_OWNER_FATHER_NAME = "owner_father_name"; + @SerializedName(SERIALIZED_NAME_OWNER_FATHER_NAME) + private String ownerFatherName; + + public static final String SERIALIZED_NAME_MOBILE_NUMBER = "mobile_number"; + @SerializedName(SERIALIZED_NAME_MOBILE_NUMBER) + private String mobileNumber; + + public static final String SERIALIZED_NAME_RC_STATUS = "rc_status"; + @SerializedName(SERIALIZED_NAME_RC_STATUS) + private String rcStatus; + + public static final String SERIALIZED_NAME_STATUS_AS_ON = "status_as_on"; + @SerializedName(SERIALIZED_NAME_STATUS_AS_ON) + private String statusAsOn; + + public static final String SERIALIZED_NAME_REG_AUTHORITY = "reg_authority"; + @SerializedName(SERIALIZED_NAME_REG_AUTHORITY) + private String regAuthority; + + public static final String SERIALIZED_NAME_REG_DATE = "reg_date"; + @SerializedName(SERIALIZED_NAME_REG_DATE) + private String regDate; + + public static final String SERIALIZED_NAME_VEHICLE_MANUFACTURING_MONTH_YEAR = "vehicle_manufacturing_month_year"; + @SerializedName(SERIALIZED_NAME_VEHICLE_MANUFACTURING_MONTH_YEAR) + private String vehicleManufacturingMonthYear; + + public static final String SERIALIZED_NAME_RC_EXPIRY_DATE = "rc_expiry_date"; + @SerializedName(SERIALIZED_NAME_RC_EXPIRY_DATE) + private String rcExpiryDate; + + public static final String SERIALIZED_NAME_VEHICLE_TAX_UPTO = "vehicle_tax_upto"; + @SerializedName(SERIALIZED_NAME_VEHICLE_TAX_UPTO) + private String vehicleTaxUpto; + + public static final String SERIALIZED_NAME_VEHICLE_INSURANCE_COMPANY_NAME = "vehicle_insurance_company_name"; + @SerializedName(SERIALIZED_NAME_VEHICLE_INSURANCE_COMPANY_NAME) + private String vehicleInsuranceCompanyName; + + public static final String SERIALIZED_NAME_VEHICLE_INSURANCE_UPTO = "vehicle_insurance_upto"; + @SerializedName(SERIALIZED_NAME_VEHICLE_INSURANCE_UPTO) + private String vehicleInsuranceUpto; + + public static final String SERIALIZED_NAME_VEHICLE_INSURANCE_POLICY_NUMBER = "vehicle_insurance_policy_number"; + @SerializedName(SERIALIZED_NAME_VEHICLE_INSURANCE_POLICY_NUMBER) + private String vehicleInsurancePolicyNumber; + + public static final String SERIALIZED_NAME_RC_FINANCER = "rc_financer"; + @SerializedName(SERIALIZED_NAME_RC_FINANCER) + private String rcFinancer; + + public static final String SERIALIZED_NAME_PRESENT_ADDRESS = "present_address"; + @SerializedName(SERIALIZED_NAME_PRESENT_ADDRESS) + private String presentAddress; + + public static final String SERIALIZED_NAME_SPLIT_PRESENT_ADDRESS = "split_present_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_PRESENT_ADDRESS) + private SplitAddress splitPresentAddress; + + public static final String SERIALIZED_NAME_PERMANENT_ADDRESS = "permanent_address"; + @SerializedName(SERIALIZED_NAME_PERMANENT_ADDRESS) + private String permanentAddress; + + public static final String SERIALIZED_NAME_SPLIT_PERMANENT_ADDRESS = "split_permanent_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_PERMANENT_ADDRESS) + private SplitAddress splitPermanentAddress; + + public static final String SERIALIZED_NAME_VEHICLE_CUBIC_CAPACITY = "vehicle_cubic_capacity"; + @SerializedName(SERIALIZED_NAME_VEHICLE_CUBIC_CAPACITY) + private String vehicleCubicCapacity; + + public static final String SERIALIZED_NAME_GROSS_VEHICLE_WEIGHT = "gross_vehicle_weight"; + @SerializedName(SERIALIZED_NAME_GROSS_VEHICLE_WEIGHT) + private String grossVehicleWeight; + + public static final String SERIALIZED_NAME_UNLADEN_WEIGHT = "unladen_weight"; + @SerializedName(SERIALIZED_NAME_UNLADEN_WEIGHT) + private String unladenWeight; + + public static final String SERIALIZED_NAME_VEHICLE_CATEGORY = "vehicle_category"; + @SerializedName(SERIALIZED_NAME_VEHICLE_CATEGORY) + private String vehicleCategory; + + public static final String SERIALIZED_NAME_RC_STANDARD_CAP = "rc_standard_cap"; + @SerializedName(SERIALIZED_NAME_RC_STANDARD_CAP) + private String rcStandardCap; + + public static final String SERIALIZED_NAME_VEHICLE_CYLINDERS_NO = "vehicle_cylinders_no"; + @SerializedName(SERIALIZED_NAME_VEHICLE_CYLINDERS_NO) + private String vehicleCylindersNo; + + public static final String SERIALIZED_NAME_VEHICLE_SEAT_CAPACITY = "vehicle_seat_capacity"; + @SerializedName(SERIALIZED_NAME_VEHICLE_SEAT_CAPACITY) + private String vehicleSeatCapacity; + + public static final String SERIALIZED_NAME_VEHICLE_SLEEPER_CAPACITY = "vehicle_sleeper_capacity"; + @SerializedName(SERIALIZED_NAME_VEHICLE_SLEEPER_CAPACITY) + private String vehicleSleeperCapacity; + + public static final String SERIALIZED_NAME_VEHICLE_STANDING_CAPACITY = "vehicle_standing_capacity"; + @SerializedName(SERIALIZED_NAME_VEHICLE_STANDING_CAPACITY) + private String vehicleStandingCapacity; + + public static final String SERIALIZED_NAME_WHEELBASE = "wheelbase"; + @SerializedName(SERIALIZED_NAME_WHEELBASE) + private String wheelbase; + + public static final String SERIALIZED_NAME_VEHICLE_NUMBER = "vehicle_number"; + @SerializedName(SERIALIZED_NAME_VEHICLE_NUMBER) + private String vehicleNumber; + + public static final String SERIALIZED_NAME_PUCC_NUMBER = "pucc_number"; + @SerializedName(SERIALIZED_NAME_PUCC_NUMBER) + private String puccNumber; + + public static final String SERIALIZED_NAME_PUCC_UPTO = "pucc_upto"; + @SerializedName(SERIALIZED_NAME_PUCC_UPTO) + private String puccUpto; + + public static final String SERIALIZED_NAME_BLACKLIST_STATUS = "blacklist_status"; + @SerializedName(SERIALIZED_NAME_BLACKLIST_STATUS) + private String blacklistStatus; + + public static final String SERIALIZED_NAME_BLACKLIST_DETAILS = "blacklist_details"; + @SerializedName(SERIALIZED_NAME_BLACKLIST_DETAILS) + private Object blacklistDetails; + + public static final String SERIALIZED_NAME_CHALLAN_DETAILS = "challan_details"; + @SerializedName(SERIALIZED_NAME_CHALLAN_DETAILS) + private Object challanDetails; + + public static final String SERIALIZED_NAME_PERMIT_ISSUE_DATE = "permit_issue_date"; + @SerializedName(SERIALIZED_NAME_PERMIT_ISSUE_DATE) + private String permitIssueDate; + + public static final String SERIALIZED_NAME_PERMIT_NUMBER = "permit_number"; + @SerializedName(SERIALIZED_NAME_PERMIT_NUMBER) + private String permitNumber; + + public static final String SERIALIZED_NAME_PERMIT_TYPE = "permit_type"; + @SerializedName(SERIALIZED_NAME_PERMIT_TYPE) + private String permitType; + + public static final String SERIALIZED_NAME_PERMIT_VALID_FROM = "permit_valid_from"; + @SerializedName(SERIALIZED_NAME_PERMIT_VALID_FROM) + private String permitValidFrom; + + public static final String SERIALIZED_NAME_PERMIT_VALID_UPTO = "permit_valid_upto"; + @SerializedName(SERIALIZED_NAME_PERMIT_VALID_UPTO) + private String permitValidUpto; + + public static final String SERIALIZED_NAME_NON_USE_STATUS = "non_use_status"; + @SerializedName(SERIALIZED_NAME_NON_USE_STATUS) + private String nonUseStatus; + + public static final String SERIALIZED_NAME_NON_USE_FROM = "non_use_from"; + @SerializedName(SERIALIZED_NAME_NON_USE_FROM) + private String nonUseFrom; + + public static final String SERIALIZED_NAME_NON_USE_TO = "non_use_to"; + @SerializedName(SERIALIZED_NAME_NON_USE_TO) + private String nonUseTo; + + public static final String SERIALIZED_NAME_NATIONAL_PERMIT_NUMBER = "national_permit_number"; + @SerializedName(SERIALIZED_NAME_NATIONAL_PERMIT_NUMBER) + private String nationalPermitNumber; + + public static final String SERIALIZED_NAME_NATIONAL_PERMIT_UPTO = "national_permit_upto"; + @SerializedName(SERIALIZED_NAME_NATIONAL_PERMIT_UPTO) + private String nationalPermitUpto; + + public static final String SERIALIZED_NAME_NATIONAL_PERMIT_ISSUED_BY = "national_permit_issued_by"; + @SerializedName(SERIALIZED_NAME_NATIONAL_PERMIT_ISSUED_BY) + private String nationalPermitIssuedBy; + + public static final String SERIALIZED_NAME_IS_COMMERCIAL = "is_commercial"; + @SerializedName(SERIALIZED_NAME_IS_COMMERCIAL) + private Boolean isCommercial; + + public static final String SERIALIZED_NAME_NOC_DETAILS = "noc_details"; + @SerializedName(SERIALIZED_NAME_NOC_DETAILS) + private String nocDetails; + + public VehicleRcResponseSchema() { + } + + public VehicleRcResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "6c617137-6d50-4c59-9302-c453ca42aa8589", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public VehicleRcResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "88", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public VehicleRcResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the vehicle RC information. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the vehicle RC information.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public VehicleRcResponseSchema regNo(String regNo) { + + this.regNo = regNo; + return this; + } + + /** + * It displays the registration number of the vehicle. + * @return regNo + **/ + @javax.annotation.Nullable + @Schema(example = "KA01MW6127", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the registration number of the vehicle.") + public String getRegNo() { + return regNo; + } + + + public void setRegNo(String regNo) { + this.regNo = regNo; + } + + + public VehicleRcResponseSchema propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * It displays the category or type of the vehicle as recognised by the relevant transportation authorities. + * @return propertyClass + **/ + @javax.annotation.Nullable + @Schema(example = "Motor Car", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the category or type of the vehicle as recognised by the relevant transportation authorities.") + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + public VehicleRcResponseSchema chassis(String chassis) { + + this.chassis = chassis; + return this; + } + + /** + * It displays the chassis information of the vehicle. + * @return chassis + **/ + @javax.annotation.Nullable + @Schema(example = "MALBK511VMM110528", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the chassis information of the vehicle.") + public String getChassis() { + return chassis; + } + + + public void setChassis(String chassis) { + this.chassis = chassis; + } + + + public VehicleRcResponseSchema engine(String engine) { + + this.engine = engine; + return this; + } + + /** + * It displays the engine number of the vehicle. + * @return engine + **/ + @javax.annotation.Nullable + @Schema(example = "G3LCMM440323", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the engine number of the vehicle.") + public String getEngine() { + return engine; + } + + + public void setEngine(String engine) { + this.engine = engine; + } + + + public VehicleRcResponseSchema vehicleManufacturerName(String vehicleManufacturerName) { + + this.vehicleManufacturerName = vehicleManufacturerName; + return this; + } + + /** + * It displays the manufacturer of the vehicle. + * @return vehicleManufacturerName + **/ + @javax.annotation.Nullable + @Schema(example = "HYUNDAI MOTOR INDIA LTD", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the manufacturer of the vehicle.") + public String getVehicleManufacturerName() { + return vehicleManufacturerName; + } + + + public void setVehicleManufacturerName(String vehicleManufacturerName) { + this.vehicleManufacturerName = vehicleManufacturerName; + } + + + public VehicleRcResponseSchema model(String model) { + + this.model = model; + return this; + } + + /** + * It displays the model number of the vehicle. + * @return model + **/ + @javax.annotation.Nullable + @Schema(example = "I20 N LINE N8 1.0TURBO GDI DCT", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the model number of the vehicle.") + public String getModel() { + return model; + } + + + public void setModel(String model) { + this.model = model; + } + + + public VehicleRcResponseSchema vehicleColor(String vehicleColor) { + + this.vehicleColor = vehicleColor; + return this; + } + + /** + * It displays the colour of the vehicle. + * @return vehicleColor + **/ + @javax.annotation.Nullable + @Schema(example = "TITAN GREY", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the colour of the vehicle.") + public String getVehicleColor() { + return vehicleColor; + } + + + public void setVehicleColor(String vehicleColor) { + this.vehicleColor = vehicleColor; + } + + + public VehicleRcResponseSchema type(String type) { + + this.type = type; + return this; + } + + /** + * It displays the type of the vehicle. + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "PETROL", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of the vehicle.") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public VehicleRcResponseSchema normsType(String normsType) { + + this.normsType = normsType; + return this; + } + + /** + * It displays the norms set by the Central Pollution Control Board (CPCB) + * @return normsType + **/ + @javax.annotation.Nullable + @Schema(example = "BHARAT STAGE VI", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the norms set by the Central Pollution Control Board (CPCB)") + public String getNormsType() { + return normsType; + } + + + public void setNormsType(String normsType) { + this.normsType = normsType; + } + + + public VehicleRcResponseSchema bodyType(String bodyType) { + + this.bodyType = bodyType; + return this; + } + + /** + * It displays the body type of the vehicle. + * @return bodyType + **/ + @javax.annotation.Nullable + @Schema(example = "HATCHBACK", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the body type of the vehicle.") + public String getBodyType() { + return bodyType; + } + + + public void setBodyType(String bodyType) { + this.bodyType = bodyType; + } + + + public VehicleRcResponseSchema ownerCount(String ownerCount) { + + this.ownerCount = ownerCount; + return this; + } + + /** + * It displays the number of owners of the vehicle. + * @return ownerCount + **/ + @javax.annotation.Nullable + @Schema(example = "1", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number of owners of the vehicle.") + public String getOwnerCount() { + return ownerCount; + } + + + public void setOwnerCount(String ownerCount) { + this.ownerCount = ownerCount; + } + + + public VehicleRcResponseSchema owner(String owner) { + + this.owner = owner; + return this; + } + + /** + * It displays the name of the current owner of the vehicle. + * @return owner + **/ + @javax.annotation.Nullable + @Schema(example = "RAGHAV RASTOGI", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the current owner of the vehicle.") + public String getOwner() { + return owner; + } + + + public void setOwner(String owner) { + this.owner = owner; + } + + + public VehicleRcResponseSchema ownerFatherName(String ownerFatherName) { + + this.ownerFatherName = ownerFatherName; + return this; + } + + /** + * It displays the father's name of the current owner of the vehicle. + * @return ownerFatherName + **/ + @javax.annotation.Nullable + @Schema(example = "ROHIT RASTOGI", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the father's name of the current owner of the vehicle.") + public String getOwnerFatherName() { + return ownerFatherName; + } + + + public void setOwnerFatherName(String ownerFatherName) { + this.ownerFatherName = ownerFatherName; + } + + + public VehicleRcResponseSchema mobileNumber(String mobileNumber) { + + this.mobileNumber = mobileNumber; + return this; + } + + /** + * It displays the mobile number of the current owner of the vehicle. + * @return mobileNumber + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the mobile number of the current owner of the vehicle.") + public String getMobileNumber() { + return mobileNumber; + } + + + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber; + } + + + public VehicleRcResponseSchema rcStatus(String rcStatus) { + + this.rcStatus = rcStatus; + return this; + } + + /** + * It displays the status of the RC. + * @return rcStatus + **/ + @javax.annotation.Nullable + @Schema(example = "ACTIVE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the RC.") + public String getRcStatus() { + return rcStatus; + } + + + public void setRcStatus(String rcStatus) { + this.rcStatus = rcStatus; + } + + + public VehicleRcResponseSchema statusAsOn(String statusAsOn) { + + this.statusAsOn = statusAsOn; + return this; + } + + /** + * It displays the particular date of the status of the RC. + * @return statusAsOn + **/ + @javax.annotation.Nullable + @Schema(example = "19/01/2024", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the particular date of the status of the RC.") + public String getStatusAsOn() { + return statusAsOn; + } + + + public void setStatusAsOn(String statusAsOn) { + this.statusAsOn = statusAsOn; + } + + + public VehicleRcResponseSchema regAuthority(String regAuthority) { + + this.regAuthority = regAuthority; + return this; + } + + /** + * It displays the name of the registration authority. + * @return regAuthority + **/ + @javax.annotation.Nullable + @Schema(example = "BENGALURU CENTRAL RTO, Karnataka", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the registration authority.") + public String getRegAuthority() { + return regAuthority; + } + + + public void setRegAuthority(String regAuthority) { + this.regAuthority = regAuthority; + } + + + public VehicleRcResponseSchema regDate(String regDate) { + + this.regDate = regDate; + return this; + } + + /** + * It displays the date of registration of the vehicle. + * @return regDate + **/ + @javax.annotation.Nullable + @Schema(example = "24/12/2021", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of registration of the vehicle.") + public String getRegDate() { + return regDate; + } + + + public void setRegDate(String regDate) { + this.regDate = regDate; + } + + + public VehicleRcResponseSchema vehicleManufacturingMonthYear(String vehicleManufacturingMonthYear) { + + this.vehicleManufacturingMonthYear = vehicleManufacturingMonthYear; + return this; + } + + /** + * It displays the month and year of the manufacturing of the vehicle. + * @return vehicleManufacturingMonthYear + **/ + @javax.annotation.Nullable + @Schema(example = "12/2021", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the month and year of the manufacturing of the vehicle.") + public String getVehicleManufacturingMonthYear() { + return vehicleManufacturingMonthYear; + } + + + public void setVehicleManufacturingMonthYear(String vehicleManufacturingMonthYear) { + this.vehicleManufacturingMonthYear = vehicleManufacturingMonthYear; + } + + + public VehicleRcResponseSchema rcExpiryDate(String rcExpiryDate) { + + this.rcExpiryDate = rcExpiryDate; + return this; + } + + /** + * It displays the date until which the registration of the vehicle is valid. + * @return rcExpiryDate + **/ + @javax.annotation.Nullable + @Schema(example = "23/12/2036", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date until which the registration of the vehicle is valid.") + public String getRcExpiryDate() { + return rcExpiryDate; + } + + + public void setRcExpiryDate(String rcExpiryDate) { + this.rcExpiryDate = rcExpiryDate; + } + + + public VehicleRcResponseSchema vehicleTaxUpto(String vehicleTaxUpto) { + + this.vehicleTaxUpto = vehicleTaxUpto; + return this; + } + + /** + * It displays the date until which the tax paid by the owner for the vehicle is valid. + * @return vehicleTaxUpto + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date until which the tax paid by the owner for the vehicle is valid.") + public String getVehicleTaxUpto() { + return vehicleTaxUpto; + } + + + public void setVehicleTaxUpto(String vehicleTaxUpto) { + this.vehicleTaxUpto = vehicleTaxUpto; + } + + + public VehicleRcResponseSchema vehicleInsuranceCompanyName(String vehicleInsuranceCompanyName) { + + this.vehicleInsuranceCompanyName = vehicleInsuranceCompanyName; + return this; + } + + /** + * It displays the name of the insurance company associated with the vehicle. + * @return vehicleInsuranceCompanyName + **/ + @javax.annotation.Nullable + @Schema(example = "TATA AIG GENERAL INSURANCE CO. LTD.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the insurance company associated with the vehicle.") + public String getVehicleInsuranceCompanyName() { + return vehicleInsuranceCompanyName; + } + + + public void setVehicleInsuranceCompanyName(String vehicleInsuranceCompanyName) { + this.vehicleInsuranceCompanyName = vehicleInsuranceCompanyName; + } + + + public VehicleRcResponseSchema vehicleInsuranceUpto(String vehicleInsuranceUpto) { + + this.vehicleInsuranceUpto = vehicleInsuranceUpto; + return this; + } + + /** + * It displays the date until which the insurance paid by the owner for the vehicle is valid. + * @return vehicleInsuranceUpto + **/ + @javax.annotation.Nullable + @Schema(example = "14/12/2024", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date until which the insurance paid by the owner for the vehicle is valid.") + public String getVehicleInsuranceUpto() { + return vehicleInsuranceUpto; + } + + + public void setVehicleInsuranceUpto(String vehicleInsuranceUpto) { + this.vehicleInsuranceUpto = vehicleInsuranceUpto; + } + + + public VehicleRcResponseSchema vehicleInsurancePolicyNumber(String vehicleInsurancePolicyNumber) { + + this.vehicleInsurancePolicyNumber = vehicleInsurancePolicyNumber; + return this; + } + + /** + * It displays the insurance policy number of the vehicle. + * @return vehicleInsurancePolicyNumber + **/ + @javax.annotation.Nullable + @Schema(example = "62000344820000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the insurance policy number of the vehicle.") + public String getVehicleInsurancePolicyNumber() { + return vehicleInsurancePolicyNumber; + } + + + public void setVehicleInsurancePolicyNumber(String vehicleInsurancePolicyNumber) { + this.vehicleInsurancePolicyNumber = vehicleInsurancePolicyNumber; + } + + + public VehicleRcResponseSchema rcFinancer(String rcFinancer) { + + this.rcFinancer = rcFinancer; + return this; + } + + /** + * It displays the name of the financial institution or lender that provided financing for the purchase of a vehicle. + * @return rcFinancer + **/ + @javax.annotation.Nullable + @Schema(example = "BANDHAN BANK", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the financial institution or lender that provided financing for the purchase of a vehicle.") + public String getRcFinancer() { + return rcFinancer; + } + + + public void setRcFinancer(String rcFinancer) { + this.rcFinancer = rcFinancer; + } + + + public VehicleRcResponseSchema presentAddress(String presentAddress) { + + this.presentAddress = presentAddress; + return this; + } + + /** + * It displays the current address of the owner of the vehicle. + * @return presentAddress + **/ + @javax.annotation.Nullable + @Schema(example = "FLAT # 901 A BLOCK GOYAL ORCHID, LAKE VIEW APTS KARIAGRAHARA, BELLANDUR, Bangalore, Karnataka, 560103", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the current address of the owner of the vehicle.") + public String getPresentAddress() { + return presentAddress; + } + + + public void setPresentAddress(String presentAddress) { + this.presentAddress = presentAddress; + } + + + public VehicleRcResponseSchema splitPresentAddress(SplitAddress splitPresentAddress) { + + this.splitPresentAddress = splitPresentAddress; + return this; + } + + /** + * Get splitPresentAddress + * @return splitPresentAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public SplitAddress getSplitPresentAddress() { + return splitPresentAddress; + } + + + public void setSplitPresentAddress(SplitAddress splitPresentAddress) { + this.splitPresentAddress = splitPresentAddress; + } + + + public VehicleRcResponseSchema permanentAddress(String permanentAddress) { + + this.permanentAddress = permanentAddress; + return this; + } + + /** + * It displays the permanent address of the owner of the vehicle. + * @return permanentAddress + **/ + @javax.annotation.Nullable + @Schema(example = "FLAT # 901 A BLOCK GOYAL ORCHID, LAKE VIEW APTS KARIAGRAHARA, BELLANDUR, Bangalore, Karnataka, 560103", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the permanent address of the owner of the vehicle.") + public String getPermanentAddress() { + return permanentAddress; + } + + + public void setPermanentAddress(String permanentAddress) { + this.permanentAddress = permanentAddress; + } + + + public VehicleRcResponseSchema splitPermanentAddress(SplitAddress splitPermanentAddress) { + + this.splitPermanentAddress = splitPermanentAddress; + return this; + } + + /** + * Get splitPermanentAddress + * @return splitPermanentAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public SplitAddress getSplitPermanentAddress() { + return splitPermanentAddress; + } + + + public void setSplitPermanentAddress(SplitAddress splitPermanentAddress) { + this.splitPermanentAddress = splitPermanentAddress; + } + + + public VehicleRcResponseSchema vehicleCubicCapacity(String vehicleCubicCapacity) { + + this.vehicleCubicCapacity = vehicleCubicCapacity; + return this; + } + + /** + * It displays the cubic capacity of the vehicle's engine. + * @return vehicleCubicCapacity + **/ + @javax.annotation.Nullable + @Schema(example = "998", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the cubic capacity of the vehicle's engine.") + public String getVehicleCubicCapacity() { + return vehicleCubicCapacity; + } + + + public void setVehicleCubicCapacity(String vehicleCubicCapacity) { + this.vehicleCubicCapacity = vehicleCubicCapacity; + } + + + public VehicleRcResponseSchema grossVehicleWeight(String grossVehicleWeight) { + + this.grossVehicleWeight = grossVehicleWeight; + return this; + } + + /** + * It displays the gross weight of the vehicle in kilograms. + * @return grossVehicleWeight + **/ + @javax.annotation.Nullable + @Schema(example = "1490", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gross weight of the vehicle in kilograms.") + public String getGrossVehicleWeight() { + return grossVehicleWeight; + } + + + public void setGrossVehicleWeight(String grossVehicleWeight) { + this.grossVehicleWeight = grossVehicleWeight; + } + + + public VehicleRcResponseSchema unladenWeight(String unladenWeight) { + + this.unladenWeight = unladenWeight; + return this; + } + + /** + * It displays the weight of the vehicle without carrying any load in kiolgrams. + * @return unladenWeight + **/ + @javax.annotation.Nullable + @Schema(example = "1086", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the weight of the vehicle without carrying any load in kiolgrams.") + public String getUnladenWeight() { + return unladenWeight; + } + + + public void setUnladenWeight(String unladenWeight) { + this.unladenWeight = unladenWeight; + } + + + public VehicleRcResponseSchema vehicleCategory(String vehicleCategory) { + + this.vehicleCategory = vehicleCategory; + return this; + } + + /** + * It displays the category of the vehicle. + * @return vehicleCategory + **/ + @javax.annotation.Nullable + @Schema(example = "LMV", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the category of the vehicle.") + public String getVehicleCategory() { + return vehicleCategory; + } + + + public void setVehicleCategory(String vehicleCategory) { + this.vehicleCategory = vehicleCategory; + } + + + public VehicleRcResponseSchema rcStandardCap(String rcStandardCap) { + + this.rcStandardCap = rcStandardCap; + return this; + } + + /** + * Get rcStandardCap + * @return rcStandardCap + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getRcStandardCap() { + return rcStandardCap; + } + + + public void setRcStandardCap(String rcStandardCap) { + this.rcStandardCap = rcStandardCap; + } + + + public VehicleRcResponseSchema vehicleCylindersNo(String vehicleCylindersNo) { + + this.vehicleCylindersNo = vehicleCylindersNo; + return this; + } + + /** + * It displays the number of cylinders present in the vehicle. + * @return vehicleCylindersNo + **/ + @javax.annotation.Nullable + @Schema(example = "3", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number of cylinders present in the vehicle.") + public String getVehicleCylindersNo() { + return vehicleCylindersNo; + } + + + public void setVehicleCylindersNo(String vehicleCylindersNo) { + this.vehicleCylindersNo = vehicleCylindersNo; + } + + + public VehicleRcResponseSchema vehicleSeatCapacity(String vehicleSeatCapacity) { + + this.vehicleSeatCapacity = vehicleSeatCapacity; + return this; + } + + /** + * It displays the number of seats in the vehicle. + * @return vehicleSeatCapacity + **/ + @javax.annotation.Nullable + @Schema(example = "5", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number of seats in the vehicle.") + public String getVehicleSeatCapacity() { + return vehicleSeatCapacity; + } + + + public void setVehicleSeatCapacity(String vehicleSeatCapacity) { + this.vehicleSeatCapacity = vehicleSeatCapacity; + } + + + public VehicleRcResponseSchema vehicleSleeperCapacity(String vehicleSleeperCapacity) { + + this.vehicleSleeperCapacity = vehicleSleeperCapacity; + return this; + } + + /** + * It displays the number of beds available in the vehicle. + * @return vehicleSleeperCapacity + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number of beds available in the vehicle.") + public String getVehicleSleeperCapacity() { + return vehicleSleeperCapacity; + } + + + public void setVehicleSleeperCapacity(String vehicleSleeperCapacity) { + this.vehicleSleeperCapacity = vehicleSleeperCapacity; + } + + + public VehicleRcResponseSchema vehicleStandingCapacity(String vehicleStandingCapacity) { + + this.vehicleStandingCapacity = vehicleStandingCapacity; + return this; + } + + /** + * It displays the number of people that can stand in the vehicle. + * @return vehicleStandingCapacity + **/ + @javax.annotation.Nullable + @Schema(example = "0", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number of people that can stand in the vehicle.") + public String getVehicleStandingCapacity() { + return vehicleStandingCapacity; + } + + + public void setVehicleStandingCapacity(String vehicleStandingCapacity) { + this.vehicleStandingCapacity = vehicleStandingCapacity; + } + + + public VehicleRcResponseSchema wheelbase(String wheelbase) { + + this.wheelbase = wheelbase; + return this; + } + + /** + * It displays distance between the front and rear axles of a vehicle in mm. + * @return wheelbase + **/ + @javax.annotation.Nullable + @Schema(example = "2580", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays distance between the front and rear axles of a vehicle in mm.") + public String getWheelbase() { + return wheelbase; + } + + + public void setWheelbase(String wheelbase) { + this.wheelbase = wheelbase; + } + + + public VehicleRcResponseSchema vehicleNumber(String vehicleNumber) { + + this.vehicleNumber = vehicleNumber; + return this; + } + + /** + * It displays the registration number of the vehicle. + * @return vehicleNumber + **/ + @javax.annotation.Nullable + @Schema(example = "KA01MW6127", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the registration number of the vehicle.") + public String getVehicleNumber() { + return vehicleNumber; + } + + + public void setVehicleNumber(String vehicleNumber) { + this.vehicleNumber = vehicleNumber; + } + + + public VehicleRcResponseSchema puccNumber(String puccNumber) { + + this.puccNumber = puccNumber; + return this; + } + + /** + * It displays the Pollution Under Control Certificate (PUCC) number associated with vehicle. + * @return puccNumber + **/ + @javax.annotation.Nullable + @Schema(example = "Newv4", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the Pollution Under Control Certificate (PUCC) number associated with vehicle.") + public String getPuccNumber() { + return puccNumber; + } + + + public void setPuccNumber(String puccNumber) { + this.puccNumber = puccNumber; + } + + + public VehicleRcResponseSchema puccUpto(String puccUpto) { + + this.puccUpto = puccUpto; + return this; + } + + /** + * It displays till when the PUCC number is valid. + * @return puccUpto + **/ + @javax.annotation.Nullable + @Schema(example = "23/12/2022", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays till when the PUCC number is valid.") + public String getPuccUpto() { + return puccUpto; + } + + + public void setPuccUpto(String puccUpto) { + this.puccUpto = puccUpto; + } + + + public VehicleRcResponseSchema blacklistStatus(String blacklistStatus) { + + this.blacklistStatus = blacklistStatus; + return this; + } + + /** + * It displays whether the vehicle is blacklisted. + * @return blacklistStatus + **/ + @javax.annotation.Nullable + @Schema(example = "NA", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the vehicle is blacklisted.") + public String getBlacklistStatus() { + return blacklistStatus; + } + + + public void setBlacklistStatus(String blacklistStatus) { + this.blacklistStatus = blacklistStatus; + } + + + public VehicleRcResponseSchema blacklistDetails(Object blacklistDetails) { + + this.blacklistDetails = blacklistDetails; + return this; + } + + /** + * It displays the reasons for blacklisting the vehicle. + * @return blacklistDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the reasons for blacklisting the vehicle.") + public Object getBlacklistDetails() { + return blacklistDetails; + } + + + public void setBlacklistDetails(Object blacklistDetails) { + this.blacklistDetails = blacklistDetails; + } + + + public VehicleRcResponseSchema challanDetails(Object challanDetails) { + + this.challanDetails = challanDetails; + return this; + } + + /** + * It displays traffic tickets or citations issued by traffic police or authorities for various traffic violations. + * @return challanDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays traffic tickets or citations issued by traffic police or authorities for various traffic violations.") + public Object getChallanDetails() { + return challanDetails; + } + + + public void setChallanDetails(Object challanDetails) { + this.challanDetails = challanDetails; + } + + + public VehicleRcResponseSchema permitIssueDate(String permitIssueDate) { + + this.permitIssueDate = permitIssueDate; + return this; + } + + /** + * It displays when the relevant authorities granted permission or authorisation for a specific type of permit associated with the vehicle. + * @return permitIssueDate + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays when the relevant authorities granted permission or authorisation for a specific type of permit associated with the vehicle.") + public String getPermitIssueDate() { + return permitIssueDate; + } + + + public void setPermitIssueDate(String permitIssueDate) { + this.permitIssueDate = permitIssueDate; + } + + + public VehicleRcResponseSchema permitNumber(String permitNumber) { + + this.permitNumber = permitNumber; + return this; + } + + /** + * It displays the permit number of the vehicle. + * @return permitNumber + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the permit number of the vehicle.") + public String getPermitNumber() { + return permitNumber; + } + + + public void setPermitNumber(String permitNumber) { + this.permitNumber = permitNumber; + } + + + public VehicleRcResponseSchema permitType(String permitType) { + + this.permitType = permitType; + return this; + } + + /** + * It displays the type of permit issued to the vehicle. + * @return permitType + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of permit issued to the vehicle.") + public String getPermitType() { + return permitType; + } + + + public void setPermitType(String permitType) { + this.permitType = permitType; + } + + + public VehicleRcResponseSchema permitValidFrom(String permitValidFrom) { + + this.permitValidFrom = permitValidFrom; + return this; + } + + /** + * It displays the beginning date of the issuance of permit. + * @return permitValidFrom + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the beginning date of the issuance of permit.") + public String getPermitValidFrom() { + return permitValidFrom; + } + + + public void setPermitValidFrom(String permitValidFrom) { + this.permitValidFrom = permitValidFrom; + } + + + public VehicleRcResponseSchema permitValidUpto(String permitValidUpto) { + + this.permitValidUpto = permitValidUpto; + return this; + } + + /** + * It displays the end date of the permit. + * @return permitValidUpto + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the end date of the permit.") + public String getPermitValidUpto() { + return permitValidUpto; + } + + + public void setPermitValidUpto(String permitValidUpto) { + this.permitValidUpto = permitValidUpto; + } + + + public VehicleRcResponseSchema nonUseStatus(String nonUseStatus) { + + this.nonUseStatus = nonUseStatus; + return this; + } + + /** + * It displays whether the vehicle owner or registrant declared that the vehicle is not in use for a certain period. + * @return nonUseStatus + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the vehicle owner or registrant declared that the vehicle is not in use for a certain period.") + public String getNonUseStatus() { + return nonUseStatus; + } + + + public void setNonUseStatus(String nonUseStatus) { + this.nonUseStatus = nonUseStatus; + } + + + public VehicleRcResponseSchema nonUseFrom(String nonUseFrom) { + + this.nonUseFrom = nonUseFrom; + return this; + } + + /** + * It displays the beginning date of the non use period. + * @return nonUseFrom + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the beginning date of the non use period.") + public String getNonUseFrom() { + return nonUseFrom; + } + + + public void setNonUseFrom(String nonUseFrom) { + this.nonUseFrom = nonUseFrom; + } + + + public VehicleRcResponseSchema nonUseTo(String nonUseTo) { + + this.nonUseTo = nonUseTo; + return this; + } + + /** + * It displays the end date of the non use period. + * @return nonUseTo + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the end date of the non use period.") + public String getNonUseTo() { + return nonUseTo; + } + + + public void setNonUseTo(String nonUseTo) { + this.nonUseTo = nonUseTo; + } + + + public VehicleRcResponseSchema nationalPermitNumber(String nationalPermitNumber) { + + this.nationalPermitNumber = nationalPermitNumber; + return this; + } + + /** + * It displays the permit issued to the vehicle to go outside the home state carrying goods. + * @return nationalPermitNumber + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the permit issued to the vehicle to go outside the home state carrying goods.") + public String getNationalPermitNumber() { + return nationalPermitNumber; + } + + + public void setNationalPermitNumber(String nationalPermitNumber) { + this.nationalPermitNumber = nationalPermitNumber; + } + + + public VehicleRcResponseSchema nationalPermitUpto(String nationalPermitUpto) { + + this.nationalPermitUpto = nationalPermitUpto; + return this; + } + + /** + * It displays the end date of the permit issued to the vechicle to go outside the home state carrying goods. + * @return nationalPermitUpto + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the end date of the permit issued to the vechicle to go outside the home state carrying goods.") + public String getNationalPermitUpto() { + return nationalPermitUpto; + } + + + public void setNationalPermitUpto(String nationalPermitUpto) { + this.nationalPermitUpto = nationalPermitUpto; + } + + + public VehicleRcResponseSchema nationalPermitIssuedBy(String nationalPermitIssuedBy) { + + this.nationalPermitIssuedBy = nationalPermitIssuedBy; + return this; + } + + /** + * It displays the national permit issuer's name. + * @return nationalPermitIssuedBy + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the national permit issuer's name.") + public String getNationalPermitIssuedBy() { + return nationalPermitIssuedBy; + } + + + public void setNationalPermitIssuedBy(String nationalPermitIssuedBy) { + this.nationalPermitIssuedBy = nationalPermitIssuedBy; + } + + + public VehicleRcResponseSchema isCommercial(Boolean isCommercial) { + + this.isCommercial = isCommercial; + return this; + } + + /** + * It displays whether the vehicle is for commercial purpose. + * @return isCommercial + **/ + @javax.annotation.Nullable + @Schema(example = "false", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays whether the vehicle is for commercial purpose.") + public Boolean getIsCommercial() { + return isCommercial; + } + + + public void setIsCommercial(Boolean isCommercial) { + this.isCommercial = isCommercial; + } + + + public VehicleRcResponseSchema nocDetails(String nocDetails) { + + this.nocDetails = nocDetails; + return this; + } + + /** + * It displays the details of the no objection certificate. + * @return nocDetails + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the details of the no objection certificate.") + public String getNocDetails() { + return nocDetails; + } + + + public void setNocDetails(String nocDetails) { + this.nocDetails = nocDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VehicleRcResponseSchema vehicleRcResponseSchema = (VehicleRcResponseSchema) o; + return Objects.equals(this.verificationId, vehicleRcResponseSchema.verificationId) && + Objects.equals(this.referenceId, vehicleRcResponseSchema.referenceId) && + Objects.equals(this.status, vehicleRcResponseSchema.status) && + Objects.equals(this.regNo, vehicleRcResponseSchema.regNo) && + Objects.equals(this.propertyClass, vehicleRcResponseSchema.propertyClass) && + Objects.equals(this.chassis, vehicleRcResponseSchema.chassis) && + Objects.equals(this.engine, vehicleRcResponseSchema.engine) && + Objects.equals(this.vehicleManufacturerName, vehicleRcResponseSchema.vehicleManufacturerName) && + Objects.equals(this.model, vehicleRcResponseSchema.model) && + Objects.equals(this.vehicleColor, vehicleRcResponseSchema.vehicleColor) && + Objects.equals(this.type, vehicleRcResponseSchema.type) && + Objects.equals(this.normsType, vehicleRcResponseSchema.normsType) && + Objects.equals(this.bodyType, vehicleRcResponseSchema.bodyType) && + Objects.equals(this.ownerCount, vehicleRcResponseSchema.ownerCount) && + Objects.equals(this.owner, vehicleRcResponseSchema.owner) && + Objects.equals(this.ownerFatherName, vehicleRcResponseSchema.ownerFatherName) && + Objects.equals(this.mobileNumber, vehicleRcResponseSchema.mobileNumber) && + Objects.equals(this.rcStatus, vehicleRcResponseSchema.rcStatus) && + Objects.equals(this.statusAsOn, vehicleRcResponseSchema.statusAsOn) && + Objects.equals(this.regAuthority, vehicleRcResponseSchema.regAuthority) && + Objects.equals(this.regDate, vehicleRcResponseSchema.regDate) && + Objects.equals(this.vehicleManufacturingMonthYear, vehicleRcResponseSchema.vehicleManufacturingMonthYear) && + Objects.equals(this.rcExpiryDate, vehicleRcResponseSchema.rcExpiryDate) && + Objects.equals(this.vehicleTaxUpto, vehicleRcResponseSchema.vehicleTaxUpto) && + Objects.equals(this.vehicleInsuranceCompanyName, vehicleRcResponseSchema.vehicleInsuranceCompanyName) && + Objects.equals(this.vehicleInsuranceUpto, vehicleRcResponseSchema.vehicleInsuranceUpto) && + Objects.equals(this.vehicleInsurancePolicyNumber, vehicleRcResponseSchema.vehicleInsurancePolicyNumber) && + Objects.equals(this.rcFinancer, vehicleRcResponseSchema.rcFinancer) && + Objects.equals(this.presentAddress, vehicleRcResponseSchema.presentAddress) && + Objects.equals(this.splitPresentAddress, vehicleRcResponseSchema.splitPresentAddress) && + Objects.equals(this.permanentAddress, vehicleRcResponseSchema.permanentAddress) && + Objects.equals(this.splitPermanentAddress, vehicleRcResponseSchema.splitPermanentAddress) && + Objects.equals(this.vehicleCubicCapacity, vehicleRcResponseSchema.vehicleCubicCapacity) && + Objects.equals(this.grossVehicleWeight, vehicleRcResponseSchema.grossVehicleWeight) && + Objects.equals(this.unladenWeight, vehicleRcResponseSchema.unladenWeight) && + Objects.equals(this.vehicleCategory, vehicleRcResponseSchema.vehicleCategory) && + Objects.equals(this.rcStandardCap, vehicleRcResponseSchema.rcStandardCap) && + Objects.equals(this.vehicleCylindersNo, vehicleRcResponseSchema.vehicleCylindersNo) && + Objects.equals(this.vehicleSeatCapacity, vehicleRcResponseSchema.vehicleSeatCapacity) && + Objects.equals(this.vehicleSleeperCapacity, vehicleRcResponseSchema.vehicleSleeperCapacity) && + Objects.equals(this.vehicleStandingCapacity, vehicleRcResponseSchema.vehicleStandingCapacity) && + Objects.equals(this.wheelbase, vehicleRcResponseSchema.wheelbase) && + Objects.equals(this.vehicleNumber, vehicleRcResponseSchema.vehicleNumber) && + Objects.equals(this.puccNumber, vehicleRcResponseSchema.puccNumber) && + Objects.equals(this.puccUpto, vehicleRcResponseSchema.puccUpto) && + Objects.equals(this.blacklistStatus, vehicleRcResponseSchema.blacklistStatus) && + Objects.equals(this.blacklistDetails, vehicleRcResponseSchema.blacklistDetails) && + Objects.equals(this.challanDetails, vehicleRcResponseSchema.challanDetails) && + Objects.equals(this.permitIssueDate, vehicleRcResponseSchema.permitIssueDate) && + Objects.equals(this.permitNumber, vehicleRcResponseSchema.permitNumber) && + Objects.equals(this.permitType, vehicleRcResponseSchema.permitType) && + Objects.equals(this.permitValidFrom, vehicleRcResponseSchema.permitValidFrom) && + Objects.equals(this.permitValidUpto, vehicleRcResponseSchema.permitValidUpto) && + Objects.equals(this.nonUseStatus, vehicleRcResponseSchema.nonUseStatus) && + Objects.equals(this.nonUseFrom, vehicleRcResponseSchema.nonUseFrom) && + Objects.equals(this.nonUseTo, vehicleRcResponseSchema.nonUseTo) && + Objects.equals(this.nationalPermitNumber, vehicleRcResponseSchema.nationalPermitNumber) && + Objects.equals(this.nationalPermitUpto, vehicleRcResponseSchema.nationalPermitUpto) && + Objects.equals(this.nationalPermitIssuedBy, vehicleRcResponseSchema.nationalPermitIssuedBy) && + Objects.equals(this.isCommercial, vehicleRcResponseSchema.isCommercial) && + Objects.equals(this.nocDetails, vehicleRcResponseSchema.nocDetails); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, referenceId, status, regNo, propertyClass, chassis, engine, vehicleManufacturerName, model, vehicleColor, type, normsType, bodyType, ownerCount, owner, ownerFatherName, mobileNumber, rcStatus, statusAsOn, regAuthority, regDate, vehicleManufacturingMonthYear, rcExpiryDate, vehicleTaxUpto, vehicleInsuranceCompanyName, vehicleInsuranceUpto, vehicleInsurancePolicyNumber, rcFinancer, presentAddress, splitPresentAddress, permanentAddress, splitPermanentAddress, vehicleCubicCapacity, grossVehicleWeight, unladenWeight, vehicleCategory, rcStandardCap, vehicleCylindersNo, vehicleSeatCapacity, vehicleSleeperCapacity, vehicleStandingCapacity, wheelbase, vehicleNumber, puccNumber, puccUpto, blacklistStatus, blacklistDetails, challanDetails, permitIssueDate, permitNumber, permitType, permitValidFrom, permitValidUpto, nonUseStatus, nonUseFrom, nonUseTo, nationalPermitNumber, nationalPermitUpto, nationalPermitIssuedBy, isCommercial, nocDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VehicleRcResponseSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" regNo: ").append(toIndentedString(regNo)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" chassis: ").append(toIndentedString(chassis)).append("\n"); + sb.append(" engine: ").append(toIndentedString(engine)).append("\n"); + sb.append(" vehicleManufacturerName: ").append(toIndentedString(vehicleManufacturerName)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" vehicleColor: ").append(toIndentedString(vehicleColor)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" normsType: ").append(toIndentedString(normsType)).append("\n"); + sb.append(" bodyType: ").append(toIndentedString(bodyType)).append("\n"); + sb.append(" ownerCount: ").append(toIndentedString(ownerCount)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" ownerFatherName: ").append(toIndentedString(ownerFatherName)).append("\n"); + sb.append(" mobileNumber: ").append(toIndentedString(mobileNumber)).append("\n"); + sb.append(" rcStatus: ").append(toIndentedString(rcStatus)).append("\n"); + sb.append(" statusAsOn: ").append(toIndentedString(statusAsOn)).append("\n"); + sb.append(" regAuthority: ").append(toIndentedString(regAuthority)).append("\n"); + sb.append(" regDate: ").append(toIndentedString(regDate)).append("\n"); + sb.append(" vehicleManufacturingMonthYear: ").append(toIndentedString(vehicleManufacturingMonthYear)).append("\n"); + sb.append(" rcExpiryDate: ").append(toIndentedString(rcExpiryDate)).append("\n"); + sb.append(" vehicleTaxUpto: ").append(toIndentedString(vehicleTaxUpto)).append("\n"); + sb.append(" vehicleInsuranceCompanyName: ").append(toIndentedString(vehicleInsuranceCompanyName)).append("\n"); + sb.append(" vehicleInsuranceUpto: ").append(toIndentedString(vehicleInsuranceUpto)).append("\n"); + sb.append(" vehicleInsurancePolicyNumber: ").append(toIndentedString(vehicleInsurancePolicyNumber)).append("\n"); + sb.append(" rcFinancer: ").append(toIndentedString(rcFinancer)).append("\n"); + sb.append(" presentAddress: ").append(toIndentedString(presentAddress)).append("\n"); + sb.append(" splitPresentAddress: ").append(toIndentedString(splitPresentAddress)).append("\n"); + sb.append(" permanentAddress: ").append(toIndentedString(permanentAddress)).append("\n"); + sb.append(" splitPermanentAddress: ").append(toIndentedString(splitPermanentAddress)).append("\n"); + sb.append(" vehicleCubicCapacity: ").append(toIndentedString(vehicleCubicCapacity)).append("\n"); + sb.append(" grossVehicleWeight: ").append(toIndentedString(grossVehicleWeight)).append("\n"); + sb.append(" unladenWeight: ").append(toIndentedString(unladenWeight)).append("\n"); + sb.append(" vehicleCategory: ").append(toIndentedString(vehicleCategory)).append("\n"); + sb.append(" rcStandardCap: ").append(toIndentedString(rcStandardCap)).append("\n"); + sb.append(" vehicleCylindersNo: ").append(toIndentedString(vehicleCylindersNo)).append("\n"); + sb.append(" vehicleSeatCapacity: ").append(toIndentedString(vehicleSeatCapacity)).append("\n"); + sb.append(" vehicleSleeperCapacity: ").append(toIndentedString(vehicleSleeperCapacity)).append("\n"); + sb.append(" vehicleStandingCapacity: ").append(toIndentedString(vehicleStandingCapacity)).append("\n"); + sb.append(" wheelbase: ").append(toIndentedString(wheelbase)).append("\n"); + sb.append(" vehicleNumber: ").append(toIndentedString(vehicleNumber)).append("\n"); + sb.append(" puccNumber: ").append(toIndentedString(puccNumber)).append("\n"); + sb.append(" puccUpto: ").append(toIndentedString(puccUpto)).append("\n"); + sb.append(" blacklistStatus: ").append(toIndentedString(blacklistStatus)).append("\n"); + sb.append(" blacklistDetails: ").append(toIndentedString(blacklistDetails)).append("\n"); + sb.append(" challanDetails: ").append(toIndentedString(challanDetails)).append("\n"); + sb.append(" permitIssueDate: ").append(toIndentedString(permitIssueDate)).append("\n"); + sb.append(" permitNumber: ").append(toIndentedString(permitNumber)).append("\n"); + sb.append(" permitType: ").append(toIndentedString(permitType)).append("\n"); + sb.append(" permitValidFrom: ").append(toIndentedString(permitValidFrom)).append("\n"); + sb.append(" permitValidUpto: ").append(toIndentedString(permitValidUpto)).append("\n"); + sb.append(" nonUseStatus: ").append(toIndentedString(nonUseStatus)).append("\n"); + sb.append(" nonUseFrom: ").append(toIndentedString(nonUseFrom)).append("\n"); + sb.append(" nonUseTo: ").append(toIndentedString(nonUseTo)).append("\n"); + sb.append(" nationalPermitNumber: ").append(toIndentedString(nationalPermitNumber)).append("\n"); + sb.append(" nationalPermitUpto: ").append(toIndentedString(nationalPermitUpto)).append("\n"); + sb.append(" nationalPermitIssuedBy: ").append(toIndentedString(nationalPermitIssuedBy)).append("\n"); + sb.append(" isCommercial: ").append(toIndentedString(isCommercial)).append("\n"); + sb.append(" nocDetails: ").append(toIndentedString(nocDetails)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("reference_id"); + openapiFields.add("status"); + openapiFields.add("reg_no"); + openapiFields.add("class"); + openapiFields.add("chassis"); + openapiFields.add("engine"); + openapiFields.add("vehicle_manufacturer_name"); + openapiFields.add("model"); + openapiFields.add("vehicle_color"); + openapiFields.add("type"); + openapiFields.add("norms_type"); + openapiFields.add("body_type"); + openapiFields.add("owner_count"); + openapiFields.add("owner"); + openapiFields.add("owner_father_name"); + openapiFields.add("mobile_number"); + openapiFields.add("rc_status"); + openapiFields.add("status_as_on"); + openapiFields.add("reg_authority"); + openapiFields.add("reg_date"); + openapiFields.add("vehicle_manufacturing_month_year"); + openapiFields.add("rc_expiry_date"); + openapiFields.add("vehicle_tax_upto"); + openapiFields.add("vehicle_insurance_company_name"); + openapiFields.add("vehicle_insurance_upto"); + openapiFields.add("vehicle_insurance_policy_number"); + openapiFields.add("rc_financer"); + openapiFields.add("present_address"); + openapiFields.add("split_present_address"); + openapiFields.add("permanent_address"); + openapiFields.add("split_permanent_address"); + openapiFields.add("vehicle_cubic_capacity"); + openapiFields.add("gross_vehicle_weight"); + openapiFields.add("unladen_weight"); + openapiFields.add("vehicle_category"); + openapiFields.add("rc_standard_cap"); + openapiFields.add("vehicle_cylinders_no"); + openapiFields.add("vehicle_seat_capacity"); + openapiFields.add("vehicle_sleeper_capacity"); + openapiFields.add("vehicle_standing_capacity"); + openapiFields.add("wheelbase"); + openapiFields.add("vehicle_number"); + openapiFields.add("pucc_number"); + openapiFields.add("pucc_upto"); + openapiFields.add("blacklist_status"); + openapiFields.add("blacklist_details"); + openapiFields.add("challan_details"); + openapiFields.add("permit_issue_date"); + openapiFields.add("permit_number"); + openapiFields.add("permit_type"); + openapiFields.add("permit_valid_from"); + openapiFields.add("permit_valid_upto"); + openapiFields.add("non_use_status"); + openapiFields.add("non_use_from"); + openapiFields.add("non_use_to"); + openapiFields.add("national_permit_number"); + openapiFields.add("national_permit_upto"); + openapiFields.add("national_permit_issued_by"); + openapiFields.add("is_commercial"); + openapiFields.add("noc_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 VehicleRcResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reg_no") != null && !jsonObj.get("reg_no").isJsonNull()) && !jsonObj.get("reg_no").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reg_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reg_no").toString())); + } + if ((jsonObj.get("class") != null && !jsonObj.get("class").isJsonNull()) && !jsonObj.get("class").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString())); + } + if ((jsonObj.get("chassis") != null && !jsonObj.get("chassis").isJsonNull()) && !jsonObj.get("chassis").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chassis` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chassis").toString())); + } + if ((jsonObj.get("engine") != null && !jsonObj.get("engine").isJsonNull()) && !jsonObj.get("engine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `engine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("engine").toString())); + } + if ((jsonObj.get("vehicle_manufacturer_name") != null && !jsonObj.get("vehicle_manufacturer_name").isJsonNull()) && !jsonObj.get("vehicle_manufacturer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_manufacturer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_manufacturer_name").toString())); + } + if ((jsonObj.get("model") != null && !jsonObj.get("model").isJsonNull()) && !jsonObj.get("model").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `model` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model").toString())); + } + if ((jsonObj.get("vehicle_color") != null && !jsonObj.get("vehicle_color").isJsonNull()) && !jsonObj.get("vehicle_color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_color").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("norms_type") != null && !jsonObj.get("norms_type").isJsonNull()) && !jsonObj.get("norms_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `norms_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("norms_type").toString())); + } + if ((jsonObj.get("body_type") != null && !jsonObj.get("body_type").isJsonNull()) && !jsonObj.get("body_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `body_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body_type").toString())); + } + if ((jsonObj.get("owner_count") != null && !jsonObj.get("owner_count").isJsonNull()) && !jsonObj.get("owner_count").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner_count` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_count").toString())); + } + if ((jsonObj.get("owner") != null && !jsonObj.get("owner").isJsonNull()) && !jsonObj.get("owner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString())); + } + if ((jsonObj.get("owner_father_name") != null && !jsonObj.get("owner_father_name").isJsonNull()) && !jsonObj.get("owner_father_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner_father_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_father_name").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + if ((jsonObj.get("rc_status") != null && !jsonObj.get("rc_status").isJsonNull()) && !jsonObj.get("rc_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_status").toString())); + } + if ((jsonObj.get("status_as_on") != null && !jsonObj.get("status_as_on").isJsonNull()) && !jsonObj.get("status_as_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status_as_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status_as_on").toString())); + } + if ((jsonObj.get("reg_authority") != null && !jsonObj.get("reg_authority").isJsonNull()) && !jsonObj.get("reg_authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reg_authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reg_authority").toString())); + } + if ((jsonObj.get("reg_date") != null && !jsonObj.get("reg_date").isJsonNull()) && !jsonObj.get("reg_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reg_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reg_date").toString())); + } + if ((jsonObj.get("vehicle_manufacturing_month_year") != null && !jsonObj.get("vehicle_manufacturing_month_year").isJsonNull()) && !jsonObj.get("vehicle_manufacturing_month_year").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_manufacturing_month_year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_manufacturing_month_year").toString())); + } + if ((jsonObj.get("rc_expiry_date") != null && !jsonObj.get("rc_expiry_date").isJsonNull()) && !jsonObj.get("rc_expiry_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_expiry_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_expiry_date").toString())); + } + if ((jsonObj.get("vehicle_tax_upto") != null && !jsonObj.get("vehicle_tax_upto").isJsonNull()) && !jsonObj.get("vehicle_tax_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_tax_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_tax_upto").toString())); + } + if ((jsonObj.get("vehicle_insurance_company_name") != null && !jsonObj.get("vehicle_insurance_company_name").isJsonNull()) && !jsonObj.get("vehicle_insurance_company_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_insurance_company_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_insurance_company_name").toString())); + } + if ((jsonObj.get("vehicle_insurance_upto") != null && !jsonObj.get("vehicle_insurance_upto").isJsonNull()) && !jsonObj.get("vehicle_insurance_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_insurance_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_insurance_upto").toString())); + } + if ((jsonObj.get("vehicle_insurance_policy_number") != null && !jsonObj.get("vehicle_insurance_policy_number").isJsonNull()) && !jsonObj.get("vehicle_insurance_policy_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_insurance_policy_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_insurance_policy_number").toString())); + } + if ((jsonObj.get("rc_financer") != null && !jsonObj.get("rc_financer").isJsonNull()) && !jsonObj.get("rc_financer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_financer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_financer").toString())); + } + if ((jsonObj.get("present_address") != null && !jsonObj.get("present_address").isJsonNull()) && !jsonObj.get("present_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `present_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("present_address").toString())); + } + // validate the optional field `split_present_address` + if (jsonObj.get("split_present_address") != null && !jsonObj.get("split_present_address").isJsonNull()) { + SplitAddress.validateJsonElement(jsonObj.get("split_present_address")); + } + if ((jsonObj.get("permanent_address") != null && !jsonObj.get("permanent_address").isJsonNull()) && !jsonObj.get("permanent_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permanent_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permanent_address").toString())); + } + // validate the optional field `split_permanent_address` + if (jsonObj.get("split_permanent_address") != null && !jsonObj.get("split_permanent_address").isJsonNull()) { + SplitAddress.validateJsonElement(jsonObj.get("split_permanent_address")); + } + if ((jsonObj.get("vehicle_cubic_capacity") != null && !jsonObj.get("vehicle_cubic_capacity").isJsonNull()) && !jsonObj.get("vehicle_cubic_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_cubic_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_cubic_capacity").toString())); + } + if ((jsonObj.get("gross_vehicle_weight") != null && !jsonObj.get("gross_vehicle_weight").isJsonNull()) && !jsonObj.get("gross_vehicle_weight").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gross_vehicle_weight` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gross_vehicle_weight").toString())); + } + if ((jsonObj.get("unladen_weight") != null && !jsonObj.get("unladen_weight").isJsonNull()) && !jsonObj.get("unladen_weight").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `unladen_weight` to be a primitive type in the JSON string but got `%s`", jsonObj.get("unladen_weight").toString())); + } + if ((jsonObj.get("vehicle_category") != null && !jsonObj.get("vehicle_category").isJsonNull()) && !jsonObj.get("vehicle_category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_category").toString())); + } + if ((jsonObj.get("rc_standard_cap") != null && !jsonObj.get("rc_standard_cap").isJsonNull()) && !jsonObj.get("rc_standard_cap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_standard_cap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_standard_cap").toString())); + } + if ((jsonObj.get("vehicle_cylinders_no") != null && !jsonObj.get("vehicle_cylinders_no").isJsonNull()) && !jsonObj.get("vehicle_cylinders_no").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_cylinders_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_cylinders_no").toString())); + } + if ((jsonObj.get("vehicle_seat_capacity") != null && !jsonObj.get("vehicle_seat_capacity").isJsonNull()) && !jsonObj.get("vehicle_seat_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_seat_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_seat_capacity").toString())); + } + if ((jsonObj.get("vehicle_sleeper_capacity") != null && !jsonObj.get("vehicle_sleeper_capacity").isJsonNull()) && !jsonObj.get("vehicle_sleeper_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_sleeper_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_sleeper_capacity").toString())); + } + if ((jsonObj.get("vehicle_standing_capacity") != null && !jsonObj.get("vehicle_standing_capacity").isJsonNull()) && !jsonObj.get("vehicle_standing_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_standing_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_standing_capacity").toString())); + } + if ((jsonObj.get("wheelbase") != null && !jsonObj.get("wheelbase").isJsonNull()) && !jsonObj.get("wheelbase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `wheelbase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wheelbase").toString())); + } + if ((jsonObj.get("vehicle_number") != null && !jsonObj.get("vehicle_number").isJsonNull()) && !jsonObj.get("vehicle_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_number").toString())); + } + if ((jsonObj.get("pucc_number") != null && !jsonObj.get("pucc_number").isJsonNull()) && !jsonObj.get("pucc_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pucc_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pucc_number").toString())); + } + if ((jsonObj.get("pucc_upto") != null && !jsonObj.get("pucc_upto").isJsonNull()) && !jsonObj.get("pucc_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pucc_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pucc_upto").toString())); + } + if ((jsonObj.get("blacklist_status") != null && !jsonObj.get("blacklist_status").isJsonNull()) && !jsonObj.get("blacklist_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blacklist_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blacklist_status").toString())); + } + if ((jsonObj.get("permit_issue_date") != null && !jsonObj.get("permit_issue_date").isJsonNull()) && !jsonObj.get("permit_issue_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_issue_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_issue_date").toString())); + } + if ((jsonObj.get("permit_number") != null && !jsonObj.get("permit_number").isJsonNull()) && !jsonObj.get("permit_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_number").toString())); + } + if ((jsonObj.get("permit_type") != null && !jsonObj.get("permit_type").isJsonNull()) && !jsonObj.get("permit_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_type").toString())); + } + if ((jsonObj.get("permit_valid_from") != null && !jsonObj.get("permit_valid_from").isJsonNull()) && !jsonObj.get("permit_valid_from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_valid_from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_valid_from").toString())); + } + if ((jsonObj.get("permit_valid_upto") != null && !jsonObj.get("permit_valid_upto").isJsonNull()) && !jsonObj.get("permit_valid_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_valid_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_valid_upto").toString())); + } + if ((jsonObj.get("non_use_status") != null && !jsonObj.get("non_use_status").isJsonNull()) && !jsonObj.get("non_use_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `non_use_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("non_use_status").toString())); + } + if ((jsonObj.get("non_use_from") != null && !jsonObj.get("non_use_from").isJsonNull()) && !jsonObj.get("non_use_from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `non_use_from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("non_use_from").toString())); + } + if ((jsonObj.get("non_use_to") != null && !jsonObj.get("non_use_to").isJsonNull()) && !jsonObj.get("non_use_to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `non_use_to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("non_use_to").toString())); + } + if ((jsonObj.get("national_permit_number") != null && !jsonObj.get("national_permit_number").isJsonNull()) && !jsonObj.get("national_permit_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `national_permit_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("national_permit_number").toString())); + } + if ((jsonObj.get("national_permit_upto") != null && !jsonObj.get("national_permit_upto").isJsonNull()) && !jsonObj.get("national_permit_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `national_permit_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("national_permit_upto").toString())); + } + if ((jsonObj.get("national_permit_issued_by") != null && !jsonObj.get("national_permit_issued_by").isJsonNull()) && !jsonObj.get("national_permit_issued_by").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `national_permit_issued_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("national_permit_issued_by").toString())); + } + if ((jsonObj.get("noc_details") != null && !jsonObj.get("noc_details").isJsonNull()) && !jsonObj.get("noc_details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `noc_details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("noc_details").toString())); + } + } + + + /** + * 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 VehicleRcResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("reg_no") != null && !jsonObj.get("reg_no").isJsonNull()) && !jsonObj.get("reg_no").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reg_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reg_no").toString())); + } + if ((jsonObj.get("class") != null && !jsonObj.get("class").isJsonNull()) && !jsonObj.get("class").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString())); + } + if ((jsonObj.get("chassis") != null && !jsonObj.get("chassis").isJsonNull()) && !jsonObj.get("chassis").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chassis` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chassis").toString())); + } + if ((jsonObj.get("engine") != null && !jsonObj.get("engine").isJsonNull()) && !jsonObj.get("engine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `engine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("engine").toString())); + } + if ((jsonObj.get("vehicle_manufacturer_name") != null && !jsonObj.get("vehicle_manufacturer_name").isJsonNull()) && !jsonObj.get("vehicle_manufacturer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_manufacturer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_manufacturer_name").toString())); + } + if ((jsonObj.get("model") != null && !jsonObj.get("model").isJsonNull()) && !jsonObj.get("model").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `model` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model").toString())); + } + if ((jsonObj.get("vehicle_color") != null && !jsonObj.get("vehicle_color").isJsonNull()) && !jsonObj.get("vehicle_color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_color").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("norms_type") != null && !jsonObj.get("norms_type").isJsonNull()) && !jsonObj.get("norms_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `norms_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("norms_type").toString())); + } + if ((jsonObj.get("body_type") != null && !jsonObj.get("body_type").isJsonNull()) && !jsonObj.get("body_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `body_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body_type").toString())); + } + if ((jsonObj.get("owner_count") != null && !jsonObj.get("owner_count").isJsonNull()) && !jsonObj.get("owner_count").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner_count` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_count").toString())); + } + if ((jsonObj.get("owner") != null && !jsonObj.get("owner").isJsonNull()) && !jsonObj.get("owner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString())); + } + if ((jsonObj.get("owner_father_name") != null && !jsonObj.get("owner_father_name").isJsonNull()) && !jsonObj.get("owner_father_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner_father_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_father_name").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + if ((jsonObj.get("rc_status") != null && !jsonObj.get("rc_status").isJsonNull()) && !jsonObj.get("rc_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_status").toString())); + } + if ((jsonObj.get("status_as_on") != null && !jsonObj.get("status_as_on").isJsonNull()) && !jsonObj.get("status_as_on").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status_as_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status_as_on").toString())); + } + if ((jsonObj.get("reg_authority") != null && !jsonObj.get("reg_authority").isJsonNull()) && !jsonObj.get("reg_authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reg_authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reg_authority").toString())); + } + if ((jsonObj.get("reg_date") != null && !jsonObj.get("reg_date").isJsonNull()) && !jsonObj.get("reg_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reg_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reg_date").toString())); + } + if ((jsonObj.get("vehicle_manufacturing_month_year") != null && !jsonObj.get("vehicle_manufacturing_month_year").isJsonNull()) && !jsonObj.get("vehicle_manufacturing_month_year").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_manufacturing_month_year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_manufacturing_month_year").toString())); + } + if ((jsonObj.get("rc_expiry_date") != null && !jsonObj.get("rc_expiry_date").isJsonNull()) && !jsonObj.get("rc_expiry_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_expiry_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_expiry_date").toString())); + } + if ((jsonObj.get("vehicle_tax_upto") != null && !jsonObj.get("vehicle_tax_upto").isJsonNull()) && !jsonObj.get("vehicle_tax_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_tax_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_tax_upto").toString())); + } + if ((jsonObj.get("vehicle_insurance_company_name") != null && !jsonObj.get("vehicle_insurance_company_name").isJsonNull()) && !jsonObj.get("vehicle_insurance_company_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_insurance_company_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_insurance_company_name").toString())); + } + if ((jsonObj.get("vehicle_insurance_upto") != null && !jsonObj.get("vehicle_insurance_upto").isJsonNull()) && !jsonObj.get("vehicle_insurance_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_insurance_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_insurance_upto").toString())); + } + if ((jsonObj.get("vehicle_insurance_policy_number") != null && !jsonObj.get("vehicle_insurance_policy_number").isJsonNull()) && !jsonObj.get("vehicle_insurance_policy_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_insurance_policy_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_insurance_policy_number").toString())); + } + if ((jsonObj.get("rc_financer") != null && !jsonObj.get("rc_financer").isJsonNull()) && !jsonObj.get("rc_financer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_financer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_financer").toString())); + } + if ((jsonObj.get("present_address") != null && !jsonObj.get("present_address").isJsonNull()) && !jsonObj.get("present_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `present_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("present_address").toString())); + } + // validate the optional field `split_present_address` + if (jsonObj.get("split_present_address") != null && !jsonObj.get("split_present_address").isJsonNull()) { + SplitAddress.validateJsonElement(jsonObj.get("split_present_address")); + return true; + } + if ((jsonObj.get("permanent_address") != null && !jsonObj.get("permanent_address").isJsonNull()) && !jsonObj.get("permanent_address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permanent_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permanent_address").toString())); + } + // validate the optional field `split_permanent_address` + if (jsonObj.get("split_permanent_address") != null && !jsonObj.get("split_permanent_address").isJsonNull()) { + SplitAddress.validateJsonElement(jsonObj.get("split_permanent_address")); + return true; + } + if ((jsonObj.get("vehicle_cubic_capacity") != null && !jsonObj.get("vehicle_cubic_capacity").isJsonNull()) && !jsonObj.get("vehicle_cubic_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_cubic_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_cubic_capacity").toString())); + } + if ((jsonObj.get("gross_vehicle_weight") != null && !jsonObj.get("gross_vehicle_weight").isJsonNull()) && !jsonObj.get("gross_vehicle_weight").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gross_vehicle_weight` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gross_vehicle_weight").toString())); + } + if ((jsonObj.get("unladen_weight") != null && !jsonObj.get("unladen_weight").isJsonNull()) && !jsonObj.get("unladen_weight").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `unladen_weight` to be a primitive type in the JSON string but got `%s`", jsonObj.get("unladen_weight").toString())); + } + if ((jsonObj.get("vehicle_category") != null && !jsonObj.get("vehicle_category").isJsonNull()) && !jsonObj.get("vehicle_category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_category").toString())); + } + if ((jsonObj.get("rc_standard_cap") != null && !jsonObj.get("rc_standard_cap").isJsonNull()) && !jsonObj.get("rc_standard_cap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rc_standard_cap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rc_standard_cap").toString())); + } + if ((jsonObj.get("vehicle_cylinders_no") != null && !jsonObj.get("vehicle_cylinders_no").isJsonNull()) && !jsonObj.get("vehicle_cylinders_no").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_cylinders_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_cylinders_no").toString())); + } + if ((jsonObj.get("vehicle_seat_capacity") != null && !jsonObj.get("vehicle_seat_capacity").isJsonNull()) && !jsonObj.get("vehicle_seat_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_seat_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_seat_capacity").toString())); + } + if ((jsonObj.get("vehicle_sleeper_capacity") != null && !jsonObj.get("vehicle_sleeper_capacity").isJsonNull()) && !jsonObj.get("vehicle_sleeper_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_sleeper_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_sleeper_capacity").toString())); + } + if ((jsonObj.get("vehicle_standing_capacity") != null && !jsonObj.get("vehicle_standing_capacity").isJsonNull()) && !jsonObj.get("vehicle_standing_capacity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_standing_capacity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_standing_capacity").toString())); + } + if ((jsonObj.get("wheelbase") != null && !jsonObj.get("wheelbase").isJsonNull()) && !jsonObj.get("wheelbase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `wheelbase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wheelbase").toString())); + } + if ((jsonObj.get("vehicle_number") != null && !jsonObj.get("vehicle_number").isJsonNull()) && !jsonObj.get("vehicle_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vehicle_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vehicle_number").toString())); + } + if ((jsonObj.get("pucc_number") != null && !jsonObj.get("pucc_number").isJsonNull()) && !jsonObj.get("pucc_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pucc_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pucc_number").toString())); + } + if ((jsonObj.get("pucc_upto") != null && !jsonObj.get("pucc_upto").isJsonNull()) && !jsonObj.get("pucc_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pucc_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pucc_upto").toString())); + } + if ((jsonObj.get("blacklist_status") != null && !jsonObj.get("blacklist_status").isJsonNull()) && !jsonObj.get("blacklist_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blacklist_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blacklist_status").toString())); + } + if ((jsonObj.get("permit_issue_date") != null && !jsonObj.get("permit_issue_date").isJsonNull()) && !jsonObj.get("permit_issue_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_issue_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_issue_date").toString())); + } + if ((jsonObj.get("permit_number") != null && !jsonObj.get("permit_number").isJsonNull()) && !jsonObj.get("permit_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_number").toString())); + } + if ((jsonObj.get("permit_type") != null && !jsonObj.get("permit_type").isJsonNull()) && !jsonObj.get("permit_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_type").toString())); + } + if ((jsonObj.get("permit_valid_from") != null && !jsonObj.get("permit_valid_from").isJsonNull()) && !jsonObj.get("permit_valid_from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_valid_from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_valid_from").toString())); + } + if ((jsonObj.get("permit_valid_upto") != null && !jsonObj.get("permit_valid_upto").isJsonNull()) && !jsonObj.get("permit_valid_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permit_valid_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permit_valid_upto").toString())); + } + if ((jsonObj.get("non_use_status") != null && !jsonObj.get("non_use_status").isJsonNull()) && !jsonObj.get("non_use_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `non_use_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("non_use_status").toString())); + } + if ((jsonObj.get("non_use_from") != null && !jsonObj.get("non_use_from").isJsonNull()) && !jsonObj.get("non_use_from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `non_use_from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("non_use_from").toString())); + } + if ((jsonObj.get("non_use_to") != null && !jsonObj.get("non_use_to").isJsonNull()) && !jsonObj.get("non_use_to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `non_use_to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("non_use_to").toString())); + } + if ((jsonObj.get("national_permit_number") != null && !jsonObj.get("national_permit_number").isJsonNull()) && !jsonObj.get("national_permit_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `national_permit_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("national_permit_number").toString())); + } + if ((jsonObj.get("national_permit_upto") != null && !jsonObj.get("national_permit_upto").isJsonNull()) && !jsonObj.get("national_permit_upto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `national_permit_upto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("national_permit_upto").toString())); + } + if ((jsonObj.get("national_permit_issued_by") != null && !jsonObj.get("national_permit_issued_by").isJsonNull()) && !jsonObj.get("national_permit_issued_by").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `national_permit_issued_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("national_permit_issued_by").toString())); + } + if ((jsonObj.get("noc_details") != null && !jsonObj.get("noc_details").isJsonNull()) && !jsonObj.get("noc_details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `noc_details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("noc_details").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VehicleRcResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VehicleRcResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VehicleRcResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VehicleRcResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VehicleRcResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VehicleRcResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of VehicleRcResponseSchema + * @throws IOException if the JSON string is invalid with respect to VehicleRcResponseSchema + */ + public static VehicleRcResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VehicleRcResponseSchema.class); + } + + /** + * Convert an instance of VehicleRcResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/VoterIdRequestSchema.java b/src/main/java/com/cashfree/model/VoterIdRequestSchema.java new file mode 100644 index 0000000..3177fc8 --- /dev/null +++ b/src/main/java/com/cashfree/model/VoterIdRequestSchema.java @@ -0,0 +1,302 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Find the request body parameters to verify the voter ID information. + */ +@Schema(description = "Find the request body parameters to verify the voter ID information.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class VoterIdRequestSchema { + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_EPIC_NUMBER = "epic_number"; + @SerializedName(SERIALIZED_NAME_EPIC_NUMBER) + private String epicNumber = "UAI4574761"; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "John Doe"; + + public VoterIdRequestSchema() { + } + + public VoterIdRequestSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * Get verificationId + * @return verificationId + **/ + @javax.annotation.Nonnull + @Schema(example = "test123", requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public VoterIdRequestSchema epicNumber(String epicNumber) { + + this.epicNumber = epicNumber; + return this; + } + + /** + * It is the unique identification number assigned to each voter ID + * @return epicNumber + **/ + @javax.annotation.Nonnull + @Schema(example = "UAI4574761", requiredMode = Schema.RequiredMode.REQUIRED, description = "It is the unique identification number assigned to each voter ID") + public String getEpicNumber() { + return epicNumber; + } + + + public void setEpicNumber(String epicNumber) { + this.epicNumber = epicNumber; + } + + + public VoterIdRequestSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It is the name of the voter ID card holder. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "John Doe", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It is the name of the voter ID card holder.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VoterIdRequestSchema voterIdRequestSchema = (VoterIdRequestSchema) o; + return Objects.equals(this.verificationId, voterIdRequestSchema.verificationId) && + Objects.equals(this.epicNumber, voterIdRequestSchema.epicNumber) && + Objects.equals(this.name, voterIdRequestSchema.name); + } + + @Override + public int hashCode() { + return Objects.hash(verificationId, epicNumber, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VoterIdRequestSchema {\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" epicNumber: ").append(toIndentedString(epicNumber)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("verification_id"); + openapiFields.add("epic_number"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("verification_id"); + openapiRequiredFields.add("epic_number"); + } + + /** + * 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 VoterIdRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VoterIdRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("epic_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `epic_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("epic_number").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + + /** + * 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 VoterIdRequestSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VoterIdRequestSchema.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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if (!jsonObj.get("epic_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `epic_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("epic_number").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VoterIdRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VoterIdRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VoterIdRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VoterIdRequestSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VoterIdRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VoterIdRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of VoterIdRequestSchema + * @throws IOException if the JSON string is invalid with respect to VoterIdRequestSchema + */ + public static VoterIdRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VoterIdRequestSchema.class); + } + + /** + * Convert an instance of VoterIdRequestSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/VoterIdResponseSchema.java b/src/main/java/com/cashfree/model/VoterIdResponseSchema.java new file mode 100644 index 0000000..ca92c1b --- /dev/null +++ b/src/main/java/com/cashfree/model/VoterIdResponseSchema.java @@ -0,0 +1,1019 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.SplitAddressSchema; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Verify Voter ID success response + */ +@Schema(description = "Verify Voter ID success response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class VoterIdResponseSchema { + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NAME_IN_REGIONAL_LANG = "name_in_regional_lang"; + @SerializedName(SERIALIZED_NAME_NAME_IN_REGIONAL_LANG) + private String nameInRegionalLang; + + public static final String SERIALIZED_NAME_AGE = "age"; + @SerializedName(SERIALIZED_NAME_AGE) + private String age; + + public static final String SERIALIZED_NAME_RELATION_TYPE = "relation_type"; + @SerializedName(SERIALIZED_NAME_RELATION_TYPE) + private String relationType; + + public static final String SERIALIZED_NAME_RELATION_NAME = "relation_name"; + @SerializedName(SERIALIZED_NAME_RELATION_NAME) + private String relationName; + + public static final String SERIALIZED_NAME_RELATION_NAME_IN_REGIONAL_LANG = "relation_name_in_regional_lang"; + @SerializedName(SERIALIZED_NAME_RELATION_NAME_IN_REGIONAL_LANG) + private String relationNameInRegionalLang; + + public static final String SERIALIZED_NAME_FATHER_NAME = "father_name"; + @SerializedName(SERIALIZED_NAME_FATHER_NAME) + private String fatherName; + + public static final String SERIALIZED_NAME_DOB = "dob"; + @SerializedName(SERIALIZED_NAME_DOB) + private String dob; + + public static final String SERIALIZED_NAME_GENDER = "gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + private String gender; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_SPLIT_ADDRESS = "split_address"; + @SerializedName(SERIALIZED_NAME_SPLIT_ADDRESS) + private SplitAddressSchema splitAddress; + + public static final String SERIALIZED_NAME_EPIC_NUMBER = "epic_number"; + @SerializedName(SERIALIZED_NAME_EPIC_NUMBER) + private String epicNumber; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_ASSEMBLY_CONSTITUENCY_NUMBER = "assembly_constituency_number"; + @SerializedName(SERIALIZED_NAME_ASSEMBLY_CONSTITUENCY_NUMBER) + private String assemblyConstituencyNumber; + + public static final String SERIALIZED_NAME_ASSEMBLY_CONSTITUENCY = "assembly_constituency"; + @SerializedName(SERIALIZED_NAME_ASSEMBLY_CONSTITUENCY) + private String assemblyConstituency; + + public static final String SERIALIZED_NAME_PARLIAMENTARY_CONSTITUENCY_NUMBER = "parliamentary_constituency_number"; + @SerializedName(SERIALIZED_NAME_PARLIAMENTARY_CONSTITUENCY_NUMBER) + private String parliamentaryConstituencyNumber; + + public static final String SERIALIZED_NAME_PARLIAMENTARY_CONSTITUENCY = "parliamentary_constituency"; + @SerializedName(SERIALIZED_NAME_PARLIAMENTARY_CONSTITUENCY) + private String parliamentaryConstituency; + + public static final String SERIALIZED_NAME_PART_NUMBER = "part_number"; + @SerializedName(SERIALIZED_NAME_PART_NUMBER) + private String partNumber; + + public static final String SERIALIZED_NAME_PART_NAME = "part_name"; + @SerializedName(SERIALIZED_NAME_PART_NAME) + private String partName; + + public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serial_number"; + @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) + private String serialNumber; + + public static final String SERIALIZED_NAME_POLLING_STATION = "polling_station"; + @SerializedName(SERIALIZED_NAME_POLLING_STATION) + private String pollingStation; + + public VoterIdResponseSchema() { + } + + public VoterIdResponseSchema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1358", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public VoterIdResponseSchema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the verification request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "testverificationid", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the verification request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public VoterIdResponseSchema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "VALID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public VoterIdResponseSchema name(String name) { + + this.name = name; + return this; + } + + /** + * It displays the name of the individual as present in the voter ID card. + * @return name + **/ + @javax.annotation.Nullable + @Schema(example = "SUSHMITHA H", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the individual as present in the voter ID card.") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public VoterIdResponseSchema nameInRegionalLang(String nameInRegionalLang) { + + this.nameInRegionalLang = nameInRegionalLang; + return this; + } + + /** + * It displays the name of the individual in the individual’s regional language as present in the voter ID card. + * @return nameInRegionalLang + **/ + @javax.annotation.Nullable + @Schema(example = "ಸುಶ್ಮಿತ ಹೆಚ್", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the individual in the individual’s regional language as present in the voter ID card.") + public String getNameInRegionalLang() { + return nameInRegionalLang; + } + + + public void setNameInRegionalLang(String nameInRegionalLang) { + this.nameInRegionalLang = nameInRegionalLang; + } + + + public VoterIdResponseSchema age(String age) { + + this.age = age; + return this; + } + + /** + * It displays the age of the voter ID holder as present in the voter ID card + * @return age + **/ + @javax.annotation.Nullable + @Schema(example = "25", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the age of the voter ID holder as present in the voter ID card") + public String getAge() { + return age; + } + + + public void setAge(String age) { + this.age = age; + } + + + public VoterIdResponseSchema relationType(String relationType) { + + this.relationType = relationType; + return this; + } + + /** + * It displays the type of the relationship with the parent/guardian as present in the voter ID card. + * @return relationType + **/ + @javax.annotation.Nullable + @Schema(example = "FTHR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the type of the relationship with the parent/guardian as present in the voter ID card.") + public String getRelationType() { + return relationType; + } + + + public void setRelationType(String relationType) { + this.relationType = relationType; + } + + + public VoterIdResponseSchema relationName(String relationName) { + + this.relationName = relationName; + return this; + } + + /** + * It displays the name of the parent/guardian as present in the voter ID card. + * @return relationName + **/ + @javax.annotation.Nullable + @Schema(example = "SUNILAKUMAR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the parent/guardian as present in the voter ID card.") + public String getRelationName() { + return relationName; + } + + + public void setRelationName(String relationName) { + this.relationName = relationName; + } + + + public VoterIdResponseSchema relationNameInRegionalLang(String relationNameInRegionalLang) { + + this.relationNameInRegionalLang = relationNameInRegionalLang; + return this; + } + + /** + * It displays the name of the parent/guardian in the individual’s regional language as present in the voter ID card. + * @return relationNameInRegionalLang + **/ + @javax.annotation.Nullable + @Schema(example = "ಸುನಿಲಕುಮಾರ", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the parent/guardian in the individual’s regional language as present in the voter ID card.") + public String getRelationNameInRegionalLang() { + return relationNameInRegionalLang; + } + + + public void setRelationNameInRegionalLang(String relationNameInRegionalLang) { + this.relationNameInRegionalLang = relationNameInRegionalLang; + } + + + public VoterIdResponseSchema fatherName(String fatherName) { + + this.fatherName = fatherName; + return this; + } + + /** + * It displays the father’s name of the individual as present in the voter ID card. + * @return fatherName + **/ + @javax.annotation.Nullable + @Schema(example = "SUNILAKUMAR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the father’s name of the individual as present in the voter ID card.") + public String getFatherName() { + return fatherName; + } + + + public void setFatherName(String fatherName) { + this.fatherName = fatherName; + } + + + public VoterIdResponseSchema dob(String dob) { + + this.dob = dob; + return this; + } + + /** + * It displays the date of birth of the individual as present in the voter ID card. + * @return dob + **/ + @javax.annotation.Nullable + @Schema(example = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the date of birth of the individual as present in the voter ID card.") + public String getDob() { + return dob; + } + + + public void setDob(String dob) { + this.dob = dob; + } + + + public VoterIdResponseSchema gender(String gender) { + + this.gender = gender; + return this; + } + + /** + * It displays the gender of the individual as present in the voter ID card. + * @return gender + **/ + @javax.annotation.Nullable + @Schema(example = "Female", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the gender of the individual as present in the voter ID card.") + public String getGender() { + return gender; + } + + + public void setGender(String gender) { + this.gender = gender; + } + + + public VoterIdResponseSchema address(String address) { + + this.address = address; + return this; + } + + /** + * It displays the address information of the individual as present in the voter ID card. + * @return address + **/ + @javax.annotation.Nullable + @Schema(example = "GOVT JUNIOR COLLEGE SIRWAR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the address information of the individual as present in the voter ID card.") + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public VoterIdResponseSchema splitAddress(SplitAddressSchema splitAddress) { + + this.splitAddress = splitAddress; + return this; + } + + /** + * Get splitAddress + * @return splitAddress + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public SplitAddressSchema getSplitAddress() { + return splitAddress; + } + + + public void setSplitAddress(SplitAddressSchema splitAddress) { + this.splitAddress = splitAddress; + } + + + public VoterIdResponseSchema epicNumber(String epicNumber) { + + this.epicNumber = epicNumber; + return this; + } + + /** + * It displays the EPIC number of the individual as present in the voter ID card. + * @return epicNumber + **/ + @javax.annotation.Nullable + @Schema(example = "XXX0000000", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the EPIC number of the individual as present in the voter ID card.") + public String getEpicNumber() { + return epicNumber; + } + + + public void setEpicNumber(String epicNumber) { + this.epicNumber = epicNumber; + } + + + public VoterIdResponseSchema state(String state) { + + this.state = state; + return this; + } + + /** + * It displays the name of the state as present in the voter ID card. + * @return state + **/ + @javax.annotation.Nullable + @Schema(example = "Karnataka", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the state as present in the voter ID card.") + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public VoterIdResponseSchema assemblyConstituencyNumber(String assemblyConstituencyNumber) { + + this.assemblyConstituencyNumber = assemblyConstituencyNumber; + return this; + } + + /** + * It displays the number associated with the assembly constituency as present in the voter ID card. + * @return assemblyConstituencyNumber + **/ + @javax.annotation.Nullable + @Schema(example = "55", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number associated with the assembly constituency as present in the voter ID card.") + public String getAssemblyConstituencyNumber() { + return assemblyConstituencyNumber; + } + + + public void setAssemblyConstituencyNumber(String assemblyConstituencyNumber) { + this.assemblyConstituencyNumber = assemblyConstituencyNumber; + } + + + public VoterIdResponseSchema assemblyConstituency(String assemblyConstituency) { + + this.assemblyConstituency = assemblyConstituency; + return this; + } + + /** + * It displays the name of the assembly constituency as present in the voter ID card. + * @return assemblyConstituency + **/ + @javax.annotation.Nullable + @Schema(example = "MANVI", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the assembly constituency as present in the voter ID card.") + public String getAssemblyConstituency() { + return assemblyConstituency; + } + + + public void setAssemblyConstituency(String assemblyConstituency) { + this.assemblyConstituency = assemblyConstituency; + } + + + public VoterIdResponseSchema parliamentaryConstituencyNumber(String parliamentaryConstituencyNumber) { + + this.parliamentaryConstituencyNumber = parliamentaryConstituencyNumber; + return this; + } + + /** + * It displays the number associated with the parliamentary constituency as present in the voter ID card. + * @return parliamentaryConstituencyNumber + **/ + @javax.annotation.Nullable + @Schema(example = "6", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the number associated with the parliamentary constituency as present in the voter ID card.") + public String getParliamentaryConstituencyNumber() { + return parliamentaryConstituencyNumber; + } + + + public void setParliamentaryConstituencyNumber(String parliamentaryConstituencyNumber) { + this.parliamentaryConstituencyNumber = parliamentaryConstituencyNumber; + } + + + public VoterIdResponseSchema parliamentaryConstituency(String parliamentaryConstituency) { + + this.parliamentaryConstituency = parliamentaryConstituency; + return this; + } + + /** + * It displays the name of the parliamentary constituency as present in the voter ID card. + * @return parliamentaryConstituency + **/ + @javax.annotation.Nullable + @Schema(example = "Raichur", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the name of the parliamentary constituency as present in the voter ID card.") + public String getParliamentaryConstituency() { + return parliamentaryConstituency; + } + + + public void setParliamentaryConstituency(String parliamentaryConstituency) { + this.parliamentaryConstituency = parliamentaryConstituency; + } + + + public VoterIdResponseSchema partNumber(String partNumber) { + + this.partNumber = partNumber; + return this; + } + + /** + * It displays the part number in the electoral roll. + * @return partNumber + **/ + @javax.annotation.Nullable + @Schema(example = "29", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the part number in the electoral roll.") + public String getPartNumber() { + return partNumber; + } + + + public void setPartNumber(String partNumber) { + this.partNumber = partNumber; + } + + + public VoterIdResponseSchema partName(String partName) { + + this.partName = partName; + return this; + } + + /** + * It displays the part name in the electoral roll. + * @return partName + **/ + @javax.annotation.Nullable + @Schema(example = "GOVERMENT JUNIOR COLLEGE 2nd Room (South Wing ) sirwar", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the part name in the electoral roll.") + public String getPartName() { + return partName; + } + + + public void setPartName(String partName) { + this.partName = partName; + } + + + public VoterIdResponseSchema serialNumber(String serialNumber) { + + this.serialNumber = serialNumber; + return this; + } + + /** + * It displays the serial number as present in the voter ID card. + * @return serialNumber + **/ + @javax.annotation.Nullable + @Schema(example = "892", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the serial number as present in the voter ID card.") + public String getSerialNumber() { + return serialNumber; + } + + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + + public VoterIdResponseSchema pollingStation(String pollingStation) { + + this.pollingStation = pollingStation; + return this; + } + + /** + * It displays the place where the individual cast votes during elections. + * @return pollingStation + **/ + @javax.annotation.Nullable + @Schema(example = "GOVT JUNIOR COLLEGE SIRWAR", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the place where the individual cast votes during elections.") + public String getPollingStation() { + return pollingStation; + } + + + public void setPollingStation(String pollingStation) { + this.pollingStation = pollingStation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VoterIdResponseSchema voterIdResponseSchema = (VoterIdResponseSchema) o; + return Objects.equals(this.referenceId, voterIdResponseSchema.referenceId) && + Objects.equals(this.verificationId, voterIdResponseSchema.verificationId) && + Objects.equals(this.status, voterIdResponseSchema.status) && + Objects.equals(this.name, voterIdResponseSchema.name) && + Objects.equals(this.nameInRegionalLang, voterIdResponseSchema.nameInRegionalLang) && + Objects.equals(this.age, voterIdResponseSchema.age) && + Objects.equals(this.relationType, voterIdResponseSchema.relationType) && + Objects.equals(this.relationName, voterIdResponseSchema.relationName) && + Objects.equals(this.relationNameInRegionalLang, voterIdResponseSchema.relationNameInRegionalLang) && + Objects.equals(this.fatherName, voterIdResponseSchema.fatherName) && + Objects.equals(this.dob, voterIdResponseSchema.dob) && + Objects.equals(this.gender, voterIdResponseSchema.gender) && + Objects.equals(this.address, voterIdResponseSchema.address) && + Objects.equals(this.splitAddress, voterIdResponseSchema.splitAddress) && + Objects.equals(this.epicNumber, voterIdResponseSchema.epicNumber) && + Objects.equals(this.state, voterIdResponseSchema.state) && + Objects.equals(this.assemblyConstituencyNumber, voterIdResponseSchema.assemblyConstituencyNumber) && + Objects.equals(this.assemblyConstituency, voterIdResponseSchema.assemblyConstituency) && + Objects.equals(this.parliamentaryConstituencyNumber, voterIdResponseSchema.parliamentaryConstituencyNumber) && + Objects.equals(this.parliamentaryConstituency, voterIdResponseSchema.parliamentaryConstituency) && + Objects.equals(this.partNumber, voterIdResponseSchema.partNumber) && + Objects.equals(this.partName, voterIdResponseSchema.partName) && + Objects.equals(this.serialNumber, voterIdResponseSchema.serialNumber) && + Objects.equals(this.pollingStation, voterIdResponseSchema.pollingStation); + } + + @Override + public int hashCode() { + return Objects.hash(referenceId, verificationId, status, name, nameInRegionalLang, age, relationType, relationName, relationNameInRegionalLang, fatherName, dob, gender, address, splitAddress, epicNumber, state, assemblyConstituencyNumber, assemblyConstituency, parliamentaryConstituencyNumber, parliamentaryConstituency, partNumber, partName, serialNumber, pollingStation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VoterIdResponseSchema {\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nameInRegionalLang: ").append(toIndentedString(nameInRegionalLang)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" relationType: ").append(toIndentedString(relationType)).append("\n"); + sb.append(" relationName: ").append(toIndentedString(relationName)).append("\n"); + sb.append(" relationNameInRegionalLang: ").append(toIndentedString(relationNameInRegionalLang)).append("\n"); + sb.append(" fatherName: ").append(toIndentedString(fatherName)).append("\n"); + sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" splitAddress: ").append(toIndentedString(splitAddress)).append("\n"); + sb.append(" epicNumber: ").append(toIndentedString(epicNumber)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" assemblyConstituencyNumber: ").append(toIndentedString(assemblyConstituencyNumber)).append("\n"); + sb.append(" assemblyConstituency: ").append(toIndentedString(assemblyConstituency)).append("\n"); + sb.append(" parliamentaryConstituencyNumber: ").append(toIndentedString(parliamentaryConstituencyNumber)).append("\n"); + sb.append(" parliamentaryConstituency: ").append(toIndentedString(parliamentaryConstituency)).append("\n"); + sb.append(" partNumber: ").append(toIndentedString(partNumber)).append("\n"); + sb.append(" partName: ").append(toIndentedString(partName)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" pollingStation: ").append(toIndentedString(pollingStation)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reference_id"); + openapiFields.add("verification_id"); + openapiFields.add("status"); + openapiFields.add("name"); + openapiFields.add("name_in_regional_lang"); + openapiFields.add("age"); + openapiFields.add("relation_type"); + openapiFields.add("relation_name"); + openapiFields.add("relation_name_in_regional_lang"); + openapiFields.add("father_name"); + openapiFields.add("dob"); + openapiFields.add("gender"); + openapiFields.add("address"); + openapiFields.add("split_address"); + openapiFields.add("epic_number"); + openapiFields.add("state"); + openapiFields.add("assembly_constituency_number"); + openapiFields.add("assembly_constituency"); + openapiFields.add("parliamentary_constituency_number"); + openapiFields.add("parliamentary_constituency"); + openapiFields.add("part_number"); + openapiFields.add("part_name"); + openapiFields.add("serial_number"); + openapiFields.add("polling_station"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 VoterIdResponseSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("name_in_regional_lang") != null && !jsonObj.get("name_in_regional_lang").isJsonNull()) && !jsonObj.get("name_in_regional_lang").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_in_regional_lang` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_in_regional_lang").toString())); + } + if ((jsonObj.get("age") != null && !jsonObj.get("age").isJsonNull()) && !jsonObj.get("age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("age").toString())); + } + if ((jsonObj.get("relation_type") != null && !jsonObj.get("relation_type").isJsonNull()) && !jsonObj.get("relation_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation_type").toString())); + } + if ((jsonObj.get("relation_name") != null && !jsonObj.get("relation_name").isJsonNull()) && !jsonObj.get("relation_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation_name").toString())); + } + if ((jsonObj.get("relation_name_in_regional_lang") != null && !jsonObj.get("relation_name_in_regional_lang").isJsonNull()) && !jsonObj.get("relation_name_in_regional_lang").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation_name_in_regional_lang` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation_name_in_regional_lang").toString())); + } + if ((jsonObj.get("father_name") != null && !jsonObj.get("father_name").isJsonNull()) && !jsonObj.get("father_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father_name").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + SplitAddressSchema.validateJsonElement(jsonObj.get("split_address")); + } + if ((jsonObj.get("epic_number") != null && !jsonObj.get("epic_number").isJsonNull()) && !jsonObj.get("epic_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `epic_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("epic_number").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("assembly_constituency_number") != null && !jsonObj.get("assembly_constituency_number").isJsonNull()) && !jsonObj.get("assembly_constituency_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assembly_constituency_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assembly_constituency_number").toString())); + } + if ((jsonObj.get("assembly_constituency") != null && !jsonObj.get("assembly_constituency").isJsonNull()) && !jsonObj.get("assembly_constituency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assembly_constituency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assembly_constituency").toString())); + } + if ((jsonObj.get("parliamentary_constituency_number") != null && !jsonObj.get("parliamentary_constituency_number").isJsonNull()) && !jsonObj.get("parliamentary_constituency_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parliamentary_constituency_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parliamentary_constituency_number").toString())); + } + if ((jsonObj.get("parliamentary_constituency") != null && !jsonObj.get("parliamentary_constituency").isJsonNull()) && !jsonObj.get("parliamentary_constituency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parliamentary_constituency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parliamentary_constituency").toString())); + } + if ((jsonObj.get("part_number") != null && !jsonObj.get("part_number").isJsonNull()) && !jsonObj.get("part_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `part_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("part_number").toString())); + } + if ((jsonObj.get("part_name") != null && !jsonObj.get("part_name").isJsonNull()) && !jsonObj.get("part_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `part_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("part_name").toString())); + } + if ((jsonObj.get("serial_number") != null && !jsonObj.get("serial_number").isJsonNull()) && !jsonObj.get("serial_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serial_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serial_number").toString())); + } + if ((jsonObj.get("polling_station") != null && !jsonObj.get("polling_station").isJsonNull()) && !jsonObj.get("polling_station").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `polling_station` to be a primitive type in the JSON string but got `%s`", jsonObj.get("polling_station").toString())); + } + } + + + /** + * 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 VoterIdResponseSchema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("name_in_regional_lang") != null && !jsonObj.get("name_in_regional_lang").isJsonNull()) && !jsonObj.get("name_in_regional_lang").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name_in_regional_lang` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_in_regional_lang").toString())); + } + if ((jsonObj.get("age") != null && !jsonObj.get("age").isJsonNull()) && !jsonObj.get("age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("age").toString())); + } + if ((jsonObj.get("relation_type") != null && !jsonObj.get("relation_type").isJsonNull()) && !jsonObj.get("relation_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation_type").toString())); + } + if ((jsonObj.get("relation_name") != null && !jsonObj.get("relation_name").isJsonNull()) && !jsonObj.get("relation_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation_name").toString())); + } + if ((jsonObj.get("relation_name_in_regional_lang") != null && !jsonObj.get("relation_name_in_regional_lang").isJsonNull()) && !jsonObj.get("relation_name_in_regional_lang").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `relation_name_in_regional_lang` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relation_name_in_regional_lang").toString())); + } + if ((jsonObj.get("father_name") != null && !jsonObj.get("father_name").isJsonNull()) && !jsonObj.get("father_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `father_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("father_name").toString())); + } + if ((jsonObj.get("dob") != null && !jsonObj.get("dob").isJsonNull()) && !jsonObj.get("dob").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dob` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dob").toString())); + } + if ((jsonObj.get("gender") != null && !jsonObj.get("gender").isJsonNull()) && !jsonObj.get("gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gender").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + // validate the optional field `split_address` + if (jsonObj.get("split_address") != null && !jsonObj.get("split_address").isJsonNull()) { + SplitAddressSchema.validateJsonElement(jsonObj.get("split_address")); + return true; + } + if ((jsonObj.get("epic_number") != null && !jsonObj.get("epic_number").isJsonNull()) && !jsonObj.get("epic_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `epic_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("epic_number").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("assembly_constituency_number") != null && !jsonObj.get("assembly_constituency_number").isJsonNull()) && !jsonObj.get("assembly_constituency_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assembly_constituency_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assembly_constituency_number").toString())); + } + if ((jsonObj.get("assembly_constituency") != null && !jsonObj.get("assembly_constituency").isJsonNull()) && !jsonObj.get("assembly_constituency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assembly_constituency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assembly_constituency").toString())); + } + if ((jsonObj.get("parliamentary_constituency_number") != null && !jsonObj.get("parliamentary_constituency_number").isJsonNull()) && !jsonObj.get("parliamentary_constituency_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parliamentary_constituency_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parliamentary_constituency_number").toString())); + } + if ((jsonObj.get("parliamentary_constituency") != null && !jsonObj.get("parliamentary_constituency").isJsonNull()) && !jsonObj.get("parliamentary_constituency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parliamentary_constituency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parliamentary_constituency").toString())); + } + if ((jsonObj.get("part_number") != null && !jsonObj.get("part_number").isJsonNull()) && !jsonObj.get("part_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `part_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("part_number").toString())); + } + if ((jsonObj.get("part_name") != null && !jsonObj.get("part_name").isJsonNull()) && !jsonObj.get("part_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `part_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("part_name").toString())); + } + if ((jsonObj.get("serial_number") != null && !jsonObj.get("serial_number").isJsonNull()) && !jsonObj.get("serial_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serial_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serial_number").toString())); + } + if ((jsonObj.get("polling_station") != null && !jsonObj.get("polling_station").isJsonNull()) && !jsonObj.get("polling_station").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `polling_station` to be a primitive type in the JSON string but got `%s`", jsonObj.get("polling_station").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VoterIdResponseSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VoterIdResponseSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VoterIdResponseSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VoterIdResponseSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VoterIdResponseSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VoterIdResponseSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of VoterIdResponseSchema + * @throws IOException if the JSON string is invalid with respect to VoterIdResponseSchema + */ + public static VoterIdResponseSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VoterIdResponseSchema.class); + } + + /** + * Convert an instance of VoterIdResponseSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/VpaFromPhone500Schema.java b/src/main/java/com/cashfree/model/VpaFromPhone500Schema.java new file mode 100644 index 0000000..abf18ac --- /dev/null +++ b/src/main/java/com/cashfree/model/VpaFromPhone500Schema.java @@ -0,0 +1,385 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Internal error response + */ +@Schema(description = "Internal error response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class VpaFromPhone500Schema { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_VERIFICATION_ID = "verification_id"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_ID) + private String verificationId; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "reference_id"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private Integer referenceId; + + public static final String SERIALIZED_NAME_ACCOUNT_STATUS = "account_status"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_STATUS) + private String accountStatus; + + public static final String SERIALIZED_NAME_MOBILE_NUMBER = "mobile_number"; + @SerializedName(SERIALIZED_NAME_MOBILE_NUMBER) + private String mobileNumber; + + public VpaFromPhone500Schema() { + } + + public VpaFromPhone500Schema status(String status) { + + this.status = status; + return this; + } + + /** + * It displays the status of the API request. + * @return status + **/ + @javax.annotation.Nullable + @Schema(example = "FAILURE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the API request.") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public VpaFromPhone500Schema verificationId(String verificationId) { + + this.verificationId = verificationId; + return this; + } + + /** + * It displays the unique ID you created to identify the API request. + * @return verificationId + **/ + @javax.annotation.Nullable + @Schema(example = "test_verification_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID you created to identify the API request.") + public String getVerificationId() { + return verificationId; + } + + + public void setVerificationId(String verificationId) { + this.verificationId = verificationId; + } + + + public VpaFromPhone500Schema message(String message) { + + this.message = message; + return this; + } + + /** + * It displays details about the success or failure of the API request + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "Unable to validate, please retry later", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays details about the success or failure of the API request") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public VpaFromPhone500Schema referenceId(Integer referenceId) { + + this.referenceId = referenceId; + return this; + } + + /** + * It displays the unique ID created by Cashfree Payments for reference purposes. + * @return referenceId + **/ + @javax.annotation.Nullable + @Schema(example = "1338", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the unique ID created by Cashfree Payments for reference purposes.") + public Integer getReferenceId() { + return referenceId; + } + + + public void setReferenceId(Integer referenceId) { + this.referenceId = referenceId; + } + + + public VpaFromPhone500Schema accountStatus(String accountStatus) { + + this.accountStatus = accountStatus; + return this; + } + + /** + * It displays the status of the account. + * @return accountStatus + **/ + @javax.annotation.Nullable + @Schema(example = "UNABLE_TO_VALIDATE", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the status of the account.") + public String getAccountStatus() { + return accountStatus; + } + + + public void setAccountStatus(String accountStatus) { + this.accountStatus = accountStatus; + } + + + public VpaFromPhone500Schema mobileNumber(String mobileNumber) { + + this.mobileNumber = mobileNumber; + return this; + } + + /** + * It displays the mobile number of the individual. + * @return mobileNumber + **/ + @javax.annotation.Nullable + @Schema(example = "7777777777", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "It displays the mobile number of the individual.") + public String getMobileNumber() { + return mobileNumber; + } + + + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VpaFromPhone500Schema vpaFromPhone500Schema = (VpaFromPhone500Schema) o; + return Objects.equals(this.status, vpaFromPhone500Schema.status) && + Objects.equals(this.verificationId, vpaFromPhone500Schema.verificationId) && + Objects.equals(this.message, vpaFromPhone500Schema.message) && + Objects.equals(this.referenceId, vpaFromPhone500Schema.referenceId) && + Objects.equals(this.accountStatus, vpaFromPhone500Schema.accountStatus) && + Objects.equals(this.mobileNumber, vpaFromPhone500Schema.mobileNumber); + } + + @Override + public int hashCode() { + return Objects.hash(status, verificationId, message, referenceId, accountStatus, mobileNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VpaFromPhone500Schema {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" verificationId: ").append(toIndentedString(verificationId)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" accountStatus: ").append(toIndentedString(accountStatus)).append("\n"); + sb.append(" mobileNumber: ").append(toIndentedString(mobileNumber)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("verification_id"); + openapiFields.add("message"); + openapiFields.add("reference_id"); + openapiFields.add("account_status"); + openapiFields.add("mobile_number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 VpaFromPhone500Schema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("account_status") != null && !jsonObj.get("account_status").isJsonNull()) && !jsonObj.get("account_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_status").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + } + + + /** + * 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 VpaFromPhone500Schema + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("verification_id") != null && !jsonObj.get("verification_id").isJsonNull()) && !jsonObj.get("verification_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_id").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("account_status") != null && !jsonObj.get("account_status").isJsonNull()) && !jsonObj.get("account_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_status").toString())); + } + if ((jsonObj.get("mobile_number") != null && !jsonObj.get("mobile_number").isJsonNull()) && !jsonObj.get("mobile_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mobile_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile_number").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VpaFromPhone500Schema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VpaFromPhone500Schema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VpaFromPhone500Schema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VpaFromPhone500Schema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VpaFromPhone500Schema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VpaFromPhone500Schema given an JSON string + * + * @param jsonString JSON string + * @return An instance of VpaFromPhone500Schema + * @throws IOException if the JSON string is invalid with respect to VpaFromPhone500Schema + */ + public static VpaFromPhone500Schema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VpaFromPhone500Schema.class); + } + + /** + * Convert an instance of VpaFromPhone500Schema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/XClientIdMissing.java b/src/main/java/com/cashfree/model/XClientIdMissing.java new file mode 100644 index 0000000..35eb42f --- /dev/null +++ b/src/main/java/com/cashfree/model/XClientIdMissing.java @@ -0,0 +1,286 @@ +/* + * Cashfree Verification API's. + * Cashfree's Verification APIs provide different types of verification to our merchants. + * + * The version of the OpenAPI document: 2023-12-18 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +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 io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * 400 response schema for missing x-client-id + */ +@Schema(description = "400 response schema for missing x-client-id") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T13:08:13.353528Z[Etc/UTC]") +public class XClientIdMissing { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public XClientIdMissing() { + } + + public XClientIdMissing type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @Schema(example = "validation_error", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public XClientIdMissing code(String code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @Schema(example = "x-client-id missing", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public XClientIdMissing message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @Schema(example = "x-client-id is missing in the request.", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XClientIdMissing xClientIdMissing = (XClientIdMissing) o; + return Objects.equals(this.type, xClientIdMissing.type) && + Objects.equals(this.code, xClientIdMissing.code) && + Objects.equals(this.message, xClientIdMissing.message); + } + + @Override + public int hashCode() { + return Objects.hash(type, code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XClientIdMissing {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("code"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * 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 XClientIdMissing + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + + /** + * 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 XClientIdMissing + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XClientIdMissing.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XClientIdMissing' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(XClientIdMissing.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XClientIdMissing value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public XClientIdMissing read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of XClientIdMissing given an JSON string + * + * @param jsonString JSON string + * @return An instance of XClientIdMissing + * @throws IOException if the JSON string is invalid with respect to XClientIdMissing + */ + public static XClientIdMissing fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XClientIdMissing.class); + } + + /** + * Convert an instance of XClientIdMissing to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +